Message-ID: <3EA1C57D.E3861F84@yahoo.com> Date: Sat, 19 Apr 2003 17:54:05 -0400 From: CBFalconer Organization: Ched Research X-Mailer: Mozilla 4.75 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: djgpp-workers AT delorie DOT com Subject: Re: nmalloc revisited References: <10304191903 DOT AA25198 AT clio DOT rice DOT edu> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Reply-To: djgpp-workers AT delorie DOT com Charles Sandmann wrote: > > > You might look at the tmalldbg source code for some usage. It > > doesn't declare any of those intermediate names, just the usual > > malloc, free, etc. The difference is in the link step. > > If this package is included in the standard libc, how will this > work? > > The current hooks allow a single library for the library code and > no special linkage steps. Unless the proposed way works with the > code in the standard library, I don't think we can use it. AFAIK the present libc doesn't include the hooks, and you have to use a different library. It is easily arranged either way. As I pointed out before, I did it this way to avoid changing the nmalloc source and test that everything is satisfactory. It is not advisable to have all that hook code in the routine library anyway, as it simply adds unused overhead. Look at the readme.txt in the zip file. As I said before, I don't like having the hooks exposed as common global variables, and would much rather install/remove them with a single function. But if people insist, I put them in and they can be used. I would much rather take them out. I highly suspect there is a lot of misunderstanding going on. Naturally, I think I have it all straight :-). As distributed in nmalloc.zip, you can do several things to try it all out without disturbing libc: Normal use - do nothing. Try nmalloc - link malloc.o before searching the library This can be replaced by replacing the malloc.o module in the library. Try debuggery - link both malldbg.o and hookmem.o before searching the library. Again, there is no reason those could not be placed in the library proper, except that if all is suitable I will combine them into a single module. In everything except the normal use case, malloc, free, and realloc are resolved before searching libc, so that the original code is never loaded. The last is what is done in the make file to create tmalldbg.exe I hope this clears it up. -- Chuck F (cbfalconer AT yahoo DOT com) (cbfalconer AT worldnet DOT att DOT net) Available for consulting/temporary embedded and systems. USE worldnet address!