Tweak comments

This commit is contained in:
Tony Garnock-Jones 2011-01-01 17:38:50 -05:00
parent 7a85e75b3d
commit 006168b544
1 changed files with 5 additions and 1 deletions

View File

@ -18,6 +18,7 @@ typedef unsigned char u_char;
#include <assert.h>
/* What is a sane value for STACK_SIZE? */
#ifdef __APPLE__
/* Bollocks. Looks like OS X chokes unless STACK_SIZE is a multiple of 32k. */
# include <AvailabilityMacros.h>
@ -33,6 +34,9 @@ typedef unsigned char u_char;
# error Define STACK_SIZE for your platform. It should probably not be less than 32k?
#endif
/* TODO: reuse stacks (via a freelist) */
/* TODO: investigate avoiding syscall in swapcontext, setcontext etc. */
static volatile int harness_running = 1;
Process *current_process = NULL;
@ -80,7 +84,7 @@ void spawn(void (*f)(void *), void *arg) {
p->state = PROCESS_DEAD;
p->stack_base = malloc(STACK_SIZE); /* what is a sane value here? 32k for mac... */
p->stack_base = malloc(STACK_SIZE);
PCHECK(p->stack_base, "stack pointer malloc");
ICHECK(getcontext(&p->context), "spawn getcontext");