1989-12-18 13:31:20 +00:00
|
|
|
/*
|
|
|
|
PROGRAM
|
|
|
|
malloc(), free(), realloc()
|
|
|
|
AUTHOR
|
|
|
|
Dick Grune, Free University, Amsterdam
|
|
|
|
Modified by Ceriel Jacobs, Free University, Amsterdam,
|
|
|
|
to make it faster
|
|
|
|
VERSION
|
1994-06-24 14:02:31 +00:00
|
|
|
$Id$
|
1989-12-18 13:31:20 +00:00
|
|
|
DESCRIPTION
|
|
|
|
This is an independent rewrite of the malloc/free package; it is
|
|
|
|
fast and efficient. Free blocks are kept in doubly linked lists,
|
|
|
|
list N holding blocks with sizes between 2**N and 2**(N+1)-1.
|
|
|
|
Consequently neither malloc nor free have to do any searching:
|
|
|
|
the cost of a call of malloc() (or free()) is constant, however
|
|
|
|
many blocks you have got.
|
|
|
|
|
|
|
|
If you switch on the NON_STANDARD macro (see param.h) every block
|
|
|
|
costs 2 pointers overhead (otherwise it's 4).
|
|
|
|
*/
|
|
|
|
/*
|
|
|
|
There is an organisational problem here: during devellopment
|
|
|
|
I want the package divided into modules, which implies external
|
|
|
|
names for the communication. The only external names I want in
|
|
|
|
the finished product are malloc, realloc and free. This requires
|
|
|
|
some hanky-panky.
|
|
|
|
*/
|