home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.lang.c:11535 comp.lang.c++:11439
- Path: sparky!uunet!darwin.sura.net!dtix!mimsy!nmrdc1!frmug!cpio1!bernard
- From: bernard@cpio1.UUCP (Bernard Fouche)
- Newsgroups: comp.lang.c,comp.lang.c++
- Subject: Re: malloc/new memory allocatio overhead?
- Message-ID: <1992Jul23.103618.280@cpio1.UUCP>
- Date: 23 Jul 92 10:36:18 GMT
- References: <1992Jul14.132746.23256@ncsu.edu>
- Sender: bernard@cpio1.UUCP (Bernard Fouche)
- Organization: CPIO S.A.
- Lines: 26
-
-
- In article <1992Jul14.132746.23256@ncsu.edu>, odkahn@eos.ncsu.edu (Opher D. Kahn) writes:
- >
- >
- > Does anybody know exactly what memory allocation overhead results
- > from a new or malloc? I am allocating the following structure/class
- > that has a sizeof == 80. How much memory is taken up by the other
- > info fields that malloc/new creates, such as the size field, pointer
- > to next malloc block, etc.? From some other indications it seems
- > that it takes ~127 bytes, but that seems like too much.
-
- Usually, on unix and using malloc(3C), the overhead is (sizeof(void
- *)) bytes per malloc. With malloc(3X) it's difficult to say because
- the routines manage pools of buffers of different size. So if you
- malloc a lot of chuncks of a particular size, some buffers inside
- malloc(3X) will have to grow and make the calculation difficult.
-
- If you want a powerfull malloc that you can hack, get gmalloc (GNU
- malloc). It's rather fast, it can give back memory to the system and
- you can see exactly what's going on because it's provided as source
- code.
- --
- -----------------------------------------------------------------------------
- Bernard Fouche VOX : +(33) (1) 48.04.56.30 FAX : (33) (1) 48.04.98.95|
- Email : bernard@cpio1.UUCP or cpio1!bernard@gna.org (try both!)
- Postal Mail : CPIO S.A., 13-15 Rue de la Verrerie, 75004 Paris, France
-