Oogaboogafy main()
This commit is contained in:
parent
68d1efb759
commit
49ca7f3406
2 changed files with 27 additions and 7 deletions
11
main.c
11
main.c
|
@ -1,7 +1,7 @@
|
|||
|
||||
int main() {
|
||||
printf("Program started\n");
|
||||
oogabooga_init(1024 * 1024 * 100); // Start with 100mb program memory
|
||||
int oogabooga_main(int argc, char **argv) {
|
||||
|
||||
|
||||
|
||||
// alloc calls to context.allocator.proc which by default is set to the
|
||||
// heap allocator in memory.c
|
||||
|
@ -37,10 +37,7 @@ int main() {
|
|||
context.extra.monkee = 69;
|
||||
|
||||
|
||||
// This can be disabled in build.c
|
||||
#if RUN_TESTS
|
||||
oogabooga_run_tests();
|
||||
#endif
|
||||
|
||||
|
||||
int hello;
|
||||
hello = 5;
|
||||
|
|
|
@ -25,3 +25,26 @@ void oogabooga_init(u64 program_memory_size) {
|
|||
heap_init();
|
||||
temporary_storage_init();
|
||||
}
|
||||
|
||||
#ifndef INITIAL_PROGRAM_MEMORY_SIZE
|
||||
#define INITIAL_PROGRAM_MEMORY_SIZE (1024ULL * 1024ULL * 100ULL) // Start with 100mb program memory
|
||||
#endif
|
||||
#ifndef RUN_TESTS
|
||||
#define RUN_TESTS 0
|
||||
#endif
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
printf("Ooga booga program started\n");
|
||||
oogabooga_init(INITIAL_PROGRAM_MEMORY_SIZE);
|
||||
|
||||
// This can be disabled in build.c
|
||||
#if RUN_TESTS
|
||||
oogabooga_run_tests();
|
||||
#endif
|
||||
|
||||
int code = oogabooga_main(argc, argv);
|
||||
|
||||
printf("Ooga booga program exit with code %i\n", code);
|
||||
|
||||
return code;
|
||||
}
|
Reference in a new issue