Oogaboogafy main()

This commit is contained in:
Charlie 2024-06-28 12:16:48 +02:00
parent 68d1efb759
commit 49ca7f3406
2 changed files with 27 additions and 7 deletions

11
main.c
View file

@ -1,7 +1,7 @@
int main() { int oogabooga_main(int argc, char **argv) {
printf("Program started\n");
oogabooga_init(1024 * 1024 * 100); // Start with 100mb program memory
// alloc calls to context.allocator.proc which by default is set to the // alloc calls to context.allocator.proc which by default is set to the
// heap allocator in memory.c // heap allocator in memory.c
@ -37,10 +37,7 @@ int main() {
context.extra.monkee = 69; context.extra.monkee = 69;
// This can be disabled in build.c
#if RUN_TESTS
oogabooga_run_tests();
#endif
int hello; int hello;
hello = 5; hello = 5;

View file

@ -25,3 +25,26 @@ void oogabooga_init(u64 program_memory_size) {
heap_init(); heap_init();
temporary_storage_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;
}