PATCH: Support to iterate over all regions in arena.

Alessandro Pignotti alexpigna.dev at gmail.com
Tue Aug 28 04:39:20 PDT 2012


Hi,

I'm attaching an updated version of the patches I've sent some time ago.
This new version have been tested on real world scenarios and seems to
work correctly. I'd like to stress that the functionality is implemented
with minimal overhead as it only needs to keep all allocated chunks in a
list. Moreover, the support is totally opt-in at compile time.

Please note that the patches do not solve the whole problem of iterating
over every object allocated by jemalloc, but only the smaller one of
iterating over objects allocated in an arena. tcache and huge regions
are not handled. Despite the limitations I think this is sufficient for
my purposes and I would like to share my work, hoping it might be
included upstream. This patch set, although limited, may be the base for
a full blown solution.

The last patch includes a simple test for the functionality. Still I
don't know how to integrate it in the build system since it requires
access to internal APIs only available in the statically linked version
of the library, while other test cases seems to link to the dynamic
version of it.

Hoping to receive some review,
Alessandro Pignotti
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Add-a-configuration-option-to-enable-iteration-over-.patch
Type: text/x-patch
Size: 2191 bytes
Desc: not available
URL: <http://jemalloc.net/mailman/jemalloc-discuss/attachments/20120828/5b5bdfc1/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-Keep-track-of-all-allocated-chunks.patch
Type: text/x-patch
Size: 2506 bytes
Desc: not available
URL: <http://jemalloc.net/mailman/jemalloc-discuss/attachments/20120828/5b5bdfc1/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-Add-a-method-to-iterate-over-objects-allocated-in-an.patch
Type: text/x-patch
Size: 3147 bytes
Desc: not available
URL: <http://jemalloc.net/mailman/jemalloc-discuss/attachments/20120828/5b5bdfc1/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0004-Add-test-for-iterate-regions.patch
Type: text/x-patch
Size: 3344 bytes
Desc: not available
URL: <http://jemalloc.net/mailman/jemalloc-discuss/attachments/20120828/5b5bdfc1/attachment-0003.bin>


More information about the jemalloc-discuss mailing list