Re: [Objectivelib-discussion] Memory allocator removal?
Brought to you by:
will_mason
From: Daniel R. <ra...@cs...> - 2005-08-03 05:10:14
|
That sounds like a good solution. Although potentially useful, allocators aren't needed, and alloc/dealloc would be consistent with everything else. Better to leave allocators out than try to fudge around with half-baked solutions. -Daniel On Aug 1, 2005, at 4:27 PM, Will Mason wrote: > I'm in the process of eliminating dependencies on Cocoa/GNUstep for > ObjectiveLib. The memory allocator code barely works under > Cocoa/GNUstep, but it completely fails in an Object-based system. The > reason is that instead of using retain/release to hang onto and un- > hang > onto objects, you have to copy the object and later free it. > There's no > way to rely on a generic copy method for any given class that will > make > use of a desired allocator, as the copy-related methods in Object have > no knowledge of ObjectiveLib memory allocators. This means that > although an OLVector, for example, can allocate its memory cache using > a given allocator, it can't copy the objects that it manages using a > given allocator. This results in half-baked memory management. > > I'm considering eliminating memory allocators as they currently exist > in ObjectiveLib in favor of letting people fall back to overriding > alloc and free/dealloc in order to get specialized memory management > for a given class. This will work equally well with all ObjectiveLib > classes and all other classes, too. > > I was hoping to get some feedback on this idea before I gut the > system. > > Thanks for any advice, > Will |