zipped the coroutine init code
parent
e4a4608007
commit
5bb69d6d96
|
@ -140,5 +140,15 @@ read_command_line(i32 argc, char **argv){
|
|||
LOG("Read command line.\n");
|
||||
}
|
||||
|
||||
internal void
|
||||
coroutines_init(){
|
||||
init_coroutine_system(&coroutines);
|
||||
|
||||
umem size = COROUTINE_SLOT_SIZE*18;
|
||||
void *mem = system_memory_allocate(size);
|
||||
coroutine_system_provide_memory(&coroutines, mem, size);
|
||||
coroutine_system_force_init(&coroutines, 4);
|
||||
}
|
||||
|
||||
// BOTTOM
|
||||
|
||||
|
|
|
@ -1629,16 +1629,7 @@ main(int argc, char **argv){
|
|||
// Coroutines
|
||||
//
|
||||
|
||||
linuxvars.coroutine_free = linuxvars.coroutine_data;
|
||||
for (i32 i = 0; i+1 < ArrayCount(linuxvars.coroutine_data); ++i){
|
||||
linuxvars.coroutine_data[i].next = &linuxvars.coroutine_data[i + 1];
|
||||
}
|
||||
|
||||
const size_t stack_size = MB(2);
|
||||
for (i32 i = 0; i < ArrayCount(linuxvars.coroutine_data); ++i){
|
||||
linuxvars.coroutine_data[i].stack.ss_size = stack_size;
|
||||
linuxvars.coroutine_data[i].stack.ss_sp = system_memory_allocate(stack_size);
|
||||
}
|
||||
coroutines_init();
|
||||
|
||||
//
|
||||
// X11 init
|
||||
|
|
|
@ -1065,14 +1065,7 @@ WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdS
|
|||
// Coroutines
|
||||
//
|
||||
|
||||
{
|
||||
init_coroutine_system(&coroutines);
|
||||
|
||||
umem size = COROUTINE_SLOT_SIZE*18;
|
||||
void *mem = system_memory_allocate(size);
|
||||
coroutine_system_provide_memory(&coroutines, mem, size);
|
||||
coroutine_system_force_init(&coroutines, 4);
|
||||
}
|
||||
coroutines_init();
|
||||
|
||||
//
|
||||
// Window and GL Initialization
|
||||
|
|
Loading…
Reference in New Issue