Extracting the starting address of the arena_run_t from the mapping information present in arena_chunk_t for each page

shireesh bhat shireeshbhat at yahoo.co.in
Thu Jul 17 13:47:59 PDT 2014

[Adding jemalloc-discuss group]

On Thursday, 17 July 2014 4:29 PM, shireesh bhat <shireeshbhat at yahoo.co.in> wrote:

Hi Jason,
Suppose I have an arena_chunk and the map has the following information
map[0].bits = 0x3ff8
map[1].bits = 0x2ff8
map[2].bits = 0x3ff8
map[3].bits = 0x149

0x149 = 101001001

In this example

Only map[3] points to an allocated page and it is a small allocation and the bin index is 0x14 but I don't have any page offset. This is the case with many small allocations and I don't have any page offset.

Since I am running on a 32 bit machine, I use the following layout mentioned in the explanation of arena_chunk_map_s
???????? ???????? ????nnnn nnnndula

Can you please tell me If I am missing something very basic.


On Thursday, 17 July 2014 3:31 PM, Jason Evans <jasone at canonware.com> wrote:

On Jul 17, 2014, at 11:28 AM, shireesh bhat <shireeshbhat at yahoo.co.in> wrote:
Even if I find out the page's offset how do I find the address of arena_run_t, since I just know the mapping information for every page which is present in arena_chunk_t.

Take a close look at the header comments for struct arena_chunk_map_s.  The information is in the chunk's page map, which it sounds like you've already figured out how to access.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://jemalloc.net/mailman/jemalloc-discuss/attachments/20140718/11e6ba07/attachment.html>

More information about the jemalloc-discuss mailing list