quakeforge/ruamoko/scheme/Frame.r

49 lines
738 B
R
Raw Normal View History

#include "Frame.h"
@implementation Frame
2011-02-14 13:39:43 +00:00
+ (id) newWithSize: (integer) sz link: (Frame *) l
{
return [[self alloc] initWithSize: sz link: l];
}
2011-02-14 13:39:43 +00:00
- (id) initWithSize: (integer) sz link: (Frame *) l
{
self = [super init];
size = sz;
link = l;
array = obj_malloc(@sizeof (id) * size);
return self;
}
2011-02-14 13:39:43 +00:00
- (void) set: (integer) index to: (SchemeObject *) o
{
array[index] = o;
}
2011-02-14 13:39:43 +00:00
- (SchemeObject *) get: (integer) index
{
return array[index];
}
2011-02-14 13:39:43 +00:00
- (Frame *) getLink
{
return link;
}
- (void) markReachable
{
local integer index;
for (index = 0; index < size; index++) {
[array[index] mark];
}
[link mark];
}
- (void) dealloc
{
obj_free(array);
[super dealloc];
}
@end