Hi,
I wonder if there's any existing implement of object that can maintain its
own ivars, before I implement one. I want something that is extremely cheap
on memory usage. May be something like..
@interface ThisThing : NSObject
{
uintptr_t _state;
[common subclass ivars];
}
- (BOOL) stateIsAllocated;
- (BOOL) hasIvar;
@end
The strategy I want is to dynamically use _state either as a pointer or an
int which can be determined by subclasses. I want it so I can simply call
object_setClass() and convert _state into a pointer that allocate some mem
for a per object ivars tables, containing types of ivars that can only be
accessed via getters/setters that take names. I need it so it may
temporarily store associated data layers with cheap lookups. Once the data
got removed it may switch back to base state at will, well, something like
that. I think it's ugly but I really want it for mixing the rare
topological representation of mutable mesh object like vertex data and
complex polygon along with simpler object types like vertex index,
simplegon, quad and tri, to maximize the mem usage. No need to be
compatible with ARC or super fast.
Thanks a lot!
Al.
--
I used to be a GNUstep developer like them, then I took an arrow in the
knee...
_______________________________________________
Etoile-dev mailing list
[email protected]
https://mail.gna.org/listinfo/etoile-dev