Patch set: support for iterating over all objects allocated in a certain arena

Alessandro Pignotti a.pignotti at sssup.it
Mon Aug 20 04:51:39 PDT 2012


Hi everyone,

while working on Lightspark (an open source flash player implementation)
I needed a way to keep track of all allocated objects. I though about
integrating with jemalloc and I have wrote a few patches that makes it
possible to iterate over all the regions allocated in a specified arena.

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.

Regards,
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/20120820/6b5326ad/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/20120820/6b5326ad/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: 2859 bytes
Desc: not available
URL: <http://jemalloc.net/mailman/jemalloc-discuss/attachments/20120820/6b5326ad/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/20120820/6b5326ad/attachment-0003.bin>


More information about the jemalloc-discuss mailing list