Ilya Zakharevich on Thu, 26 Jun 2003 08:07:17 -0700

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: memory management

On Thu, Jun 26, 2003 at 04:18:10PM +0200, Bill Allombert wrote:
> > I do not know what over ways of memory allocation do you mean here.
> > It is either malloc()/sbrk(), or memory-map.  Both do not allow a
> > growth, AFAIK.
> You can use sbrk() directly. If you use a single sbrk()ed memory bloc
> you can grow it.

No you can't - in general.  Only if you did not do any intervening
memory allocations.  And a smart [re/m]alloc() could do the same.
Actually, my (= perl's) malloc does.  ;-)

> GAP use that, AFAIK. Of course, this forbid the use of malloc() in
> the code.

... so it is useless for any practical purpose in a library mode...

Hope this helps,