Path: utzoo!utgpu!attcan!uunet!mcvax!enea!dkuug!freja!njk From: njk@freja.dk (Niels J|rgen Kruse) Newsgroups: comp.lang.c Subject: Re: memory allocation Message-ID: <4093@freja.dk> Date: 26 Sep 88 21:25:46 GMT References: <1262@micomvax.UUCP> <733@proxftl.UUCP> <33184@cca.CCA.COM> <33422@cca.CCA.COM> Distribution: comp.lang.c,comp.os.misc Organization: DIKU, U of Copenhagen, DK Lines: 22 In article <33422@cca.CCA.COM>, g-rh@cca.CCA.COM (Richard Harter) writes: > One point which I feel strongly about is that most allocators use the > blocks (free and allocated) to hold control information. I think that > this is a mistake. I put all control information in structures in a > separate node space. This adds overhead, but it makes life a lot safer. > Array indexing errors do not damage the allocator. Free's can be checked ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > for validity. But then they will damage something else. The consequences of this may be much more suptle and affect output only without being fatal. Non-fatal bugs does not make life easier! Corrupting the allocators overhead information is almost allways fatal (eventually) and can be checked for with heapwalkers, to pinpoint the cause. In particular, liberation with boundary tags gives a heap with a lot of redundant information that can be compared for consistency. Such a heapwalker ought to be supplied with allocators that store overhead information in the heap area. Niels J|rgen Kruse Stud. Scient. at DIKU (U. of Copenhagen)