discuss-gnustep
[Top][All Lists]
Advanced

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

NSZoneMalloc() vs. objc_malloc() vs. malloc() ...


From: Kai Henningsen
Subject: NSZoneMalloc() vs. objc_malloc() vs. malloc() ...
Date: Mon, 13 May 2002 16:23:14 +0200

I just tried to supply my own memory management routines via the 
_objc_malloc etc. hooks. The program promptly died.

On investigation, it seems that GNUstep is mixing all three 
allocation systems from the subject, allocating stuff via one variant 
and freeing it via another (the one that just bit me is 
NSFileManager, allocating via custom_strdup via NSZoneMalloc() [and 
shouldn't that have been NSZoneMallocAtomic()?] and freeing via 
gsedRelease via free().)

Fixing this seems a fairly mechanical task - *except* one would first 
need a clear direction on what should actually be used. (I'm assuming 
here that we *don't* want to use different allocation routines in 
different parts of the library, except when implementing same.)

Comments?
Regards - Kai Henningsen

-- 
http://www.cats.ms
Spuentrup CTI       Fon: +49 700 CALL CATS (=22 55 22 87)
Windbreede 12       Fax: +49 251 322312 99
D-48157 Muenster    Mob: +49 161 322312 1
Germany             GSM: +49 171 7755060




reply via email to

[Prev in Thread] Current Thread [Next in Thread]