Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 19 Oct 2006 18:23:59 +0200
From:      Leidecker@stud.uni-heidelberg.de
To:        freebsd-questions@freebsd.org
Subject:   chunk size
Message-ID:  <20061019182359.2jje9s9uok844k8w@wwwmail.urz.uni-heidelberg.de>

next in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20061019182359.2jje9s9uok844k8w>