chunk size

Leidecker at stud.uni-heidelberg.de Leidecker at stud.uni-heidelberg.de
Thu Oct 19 16:24:08 UTC 2006


Hi there,

I ran into trouble with memory allocation in freebsd.
In Linux, informations on heap chunks are stored with the actual data.  
That's why a chunks' size is four bytes before the raw data.

Let's say, there is memory allocated at address 0x0804b000. In Linux,  
that would return me the number allocated bytes:
(gdb) x/x 0x0804b000-4

FreeBSD uses another malloc alternative where the data and the  
informations are splitted into two lists. The informations on sizes  
are stored in a page direcory list. Entries of that list point to  
their corresponding page with the data. My question is now, regarding  
on the usage of gdb: How can I find out, of what size a chunk is? Or,  
where do I find the page direcory list?

regards,
Nico



More information about the freebsd-questions mailing list