From mboxrd@z Thu Jan 1 00:00:00 1970 To: 9fans@cse.psu.edu From: "Douglas A. Gwyn" Message-ID: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit References: <20040307113209.GA18849@melkki.cs.Helsinki.FI> Subject: Re: [9fans] making emalloc a library function Date: Mon, 8 Mar 2004 10:25:57 +0000 Topicbox-Message-UUID: 22f1e094-eacd-11e9-9e20-41e7f4b1d025 Einar Karttunen wrote: > I have two alternative routes. Either make libemalloc which contains > emalloc, estrdup and so on or add a flag which makes libc malloc behave > like emalloc. It is a *very* bad idea to change the behavior of malloc(). Your program might link with some library that knows how to recover when malloc() reports failure, and if you change malloc() to act like emalloc() you will break that library. There should be no problem adding emalloc() to the system C library.