Skip to content

Commit

Permalink
Merge pull request #374 from waywardmonkeys/gc-init-fix
Browse files Browse the repository at this point in the history
[crt, cbe]: Move GC_INIT to the runtime init.
  • Loading branch information
housel committed Dec 20, 2012
2 parents 783fbc7 + 842e985 commit 0ff69dc
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
3 changes: 0 additions & 3 deletions sources/dfmc/c-linker/c-gluefile.dylan
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,13 @@ define sideways method emit-mainfile
let c-file = #f;
with-build-area-output (stream = ld, base: "_main", type: "c")
write(stream, "#include <stdlib.h>\n");
write(stream, "#include <gc/gc.h>\n\n");
write(stream, "#include \"run-time.h\"\n\n");

format(stream, "int main (int argc, char *argv[]) {\n");
format(stream, " extern void %s ();\n", glue-name(lib-name));
format(stream, " extern D %s;\n", command-arguments-name());
format(stream, " extern D %s;\n", command-name-name());

format(stream, " GC_INIT();\n");

write (stream, " D args = primitive_make_vector((argc > 0) ? argc - 1 : 0);\n");
write (stream, " int i;\n");
format(stream, " if (argc > 0)\n");
Expand Down
2 changes: 1 addition & 1 deletion sources/dfmc/c-run-time/run-time.c
Original file line number Diff line number Diff line change
Expand Up @@ -4759,7 +4759,7 @@ void _Init_Run_Time ()
#endif

// initialize GC and thread subsystems
GC_init();
GC_INIT();
initialize_threads_primitives();
GC_set_max_heap_size(MAX_HEAP_SIZE);

Expand Down

0 comments on commit 0ff69dc

Please sign in to comment.