Re: segfault with linux

From: j.p.lewis <>
Date: Mon, 19 Dec 1994 13:29:57 -0800 (PST)

What your describing is incorrect programming, but it will work correctly in
most implementations of malloc/free. Freeing generally just puts
the freed memory on a 'free list', but does not actually write
over the memory; this would typically happen after a subsequent malloc.

free() returns memory to malloc's "arena", which *belongs to the process*;
it does not (as one might expect) return memory to the operating system.

Under Unix, a program doing dynamic allocation with malloc/free will
grow but will never shrink in size.

On Thu, 10 Nov 1994, Johann Friedrich Heinrichmeyer wrote:

> deallocation schemes did not lead to errors. Linked list where
> deallocated by first freeing structures and then evaluating the
> list->next pointers (at a time where the memory was no more valid). It
> worked absolutely relyable. We suspect since them that free() is only a
> empty function (simple return) on some workstations:-). Also the memory
> consumption of "perl" leads to this assumption.
> --
> Fritz Heinrichmeyer FernUniversitaet Hagen
> FAX: +49 2371/5221 LG Elektronische Schaltungen
> EMAIL: Frauenstuhlweg 31
> PHONE: +49 02371/566-243 58644 Iserlohn (Germany)
> WWW:
Received on Mon Dec 19 1994 - 22:43:18 CET

This archive was generated by hypermail 2.3.0 : Mon Jul 21 2014 - 19:38:59 CEST