| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
On Sep 30, 2005, at 1:09 AM, Niko Matsakis wrote:
What I'd like to do is something like:
@implementation NSObject (ArenaCategory)
+ (id)allocWithArena:(Arena*)arena { void *mem = arena_alloc (arena, sizeof (???)); initialize memory:mem; return (id)mem; }
@end
As you can see I'm not sure how to:
1. Find out the size of the class object which received the message
2. Initialize the memory with whatever details ObjC needs to know what kind of object this is
struct arenaNSObject {
@defs(NSObject)
...arena vars...
}-Shawn
| References: | |
| >custom memory allocations (From: Niko Matsakis <email@hidden>) |
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2007 Apple Inc. All rights reserved.