Not logged in
Log in now
Create an account
Subscribe to LWN
LWN.net Weekly Edition for May 23, 2013
An "enum" for Python 3
An unexpected perf feature
LWN.net Weekly Edition for May 16, 2013
A look at the PyPy 2.0 release
Doubling the size of every allocation seems pretty wasteful, couldn't a bitmap be used
instead, with byte or even word-level granularity?
new_size = (size + (size/8))
Posted Nov 29, 2007 14:44 UTC (Thu) by nix (subscriber, #2304)
A bitmap definitely can be used instead. (This is how valgrind's memcheck
tool implements uninitialized checks, although using JIT simulation rather
than page faulting to detect accesses.)
Posted Nov 29, 2007 15:20 UTC (Thu) by jreiser (subscriber, #11027)
On a 32-bit machine it is tempting to use 8 bits (an entire byte) to track access to 32 bits
(one word) of memory. This gives speed while still saving some space.
Posted Nov 29, 2007 18:16 UTC (Thu) by felixfix (subscriber, #242)
The code to map bits would be slower; maybe he did not like the tradeoff.
Posted Nov 29, 2007 18:41 UTC (Thu) by lysse (guest, #3190)
When there's already a page fault happening on every memory access, I have some doubts of the
significance of such additional overhead.
Posted Nov 29, 2007 18:52 UTC (Thu) by felixfix (subscriber, #242)
Well, hmmmm, I guess I was thinking just enough to stick my foot in my mouth :-)
Posted Nov 29, 2007 19:06 UTC (Thu) by nix (subscriber, #2304)
Also the extra memory accesses will tend to blow the cache more if you use
more memory to track the uninit state.
Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds