Skip to content

Commit

Permalink
Add function for GC-allocating a heap frame.
Browse files Browse the repository at this point in the history
  • Loading branch information
jnthn committed Apr 20, 2016
1 parent 2ec94b7 commit 773c620
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/gc/allocation.c
Expand Up @@ -97,6 +97,15 @@ MVMObject * MVM_gc_allocate_object(MVMThreadContext *tc, MVMSTable *st) {
return obj;
}

/* Allocates a new heap frame. */
MVMFrame * MVM_gc_allocate_frame(MVMThreadContext *tc) {
MVMFrame *f = MVM_gc_allocate_zeroed(tc, sizeof(MVMFrame));
f->header.flags |= MVM_CF_FRAME;
f->header.size = sizeof(MVMFrame);
f->header.owner = tc->thread_id;
return f;
}

/* Sets allocate for this thread to be from the second generation by
* default. */
void MVM_gc_allocate_gen2_default_set(MVMThreadContext *tc) {
Expand Down
1 change: 1 addition & 0 deletions src/gc/allocation.h
Expand Up @@ -3,6 +3,7 @@ void * MVM_gc_allocate_zeroed(MVMThreadContext *tc, size_t size);
MVMSTable * MVM_gc_allocate_stable(MVMThreadContext *tc, const MVMREPROps *repr, MVMObject *how);
MVMObject * MVM_gc_allocate_type_object(MVMThreadContext *tc, MVMSTable *st);
MVMObject * MVM_gc_allocate_object(MVMThreadContext *tc, MVMSTable *st);
MVMFrame * MVM_gc_allocate_frame(MVMThreadContext *tc);
void MVM_gc_allocate_gen2_default_set(MVMThreadContext *tc);
void MVM_gc_allocate_gen2_default_clear(MVMThreadContext *tc);

Expand Down

0 comments on commit 773c620

Please sign in to comment.