Commit e59b4b94 authored by Michael Quigley's avatar Michael Quigley
Browse files

Fixed Barrelfish stack freeing bug, updated tests.

parent e8ff16ed
......@@ -558,8 +558,13 @@ static void thc_end_rts(void) {
// book-keeping: once the dispatch loop is done, then the
// number of stacks on our free list should equal the number
// allocated from the OS.
void* next_stack;
while (pts->free_stacks != NULL) {
pts->free_stacks = pts->free_stacks->next;
next_stack = pts->free_stacks->next;
#ifdef LINUX_KERNEL
kfree(pts->free_stacks);
#endif
pts->free_stacks = next_stack;
#ifndef NDEBUG
pts->stackMemoriesDeallocated ++;
#endif
......
......@@ -32,6 +32,8 @@ static int test_ctx_switch(void)
int i;
for( i = 0; i < NUM_SWITCH_MEASUREMENTS; i++ )
{
thc_init();
DO_FINISH_(ctx_switch,{
ASYNC({
msg_id = awe_mapper_create_id();
......@@ -44,6 +46,7 @@ static int test_ctx_switch(void)
awe_mapper_remove_id(msg_id);
});
});
thc_done();
measurements_arr[i] = end_time - start_time;
}
......@@ -57,6 +60,8 @@ static int test_thread_creation(void)
unsigned long start_time, end_time;
int i;
thc_init();
for( i = 0; i < NUM_SWITCH_MEASUREMENTS; i++ )
{
DO_FINISH_(thread_creation,{
......@@ -68,6 +73,7 @@ static int test_thread_creation(void)
measurements_arr[i] = end_time - start_time;
}
thc_done();
return 0;
}
......@@ -79,11 +85,9 @@ static int thread_fn(void* data)
preempt_disable();
local_irq_disable();
thc_init();
LCD_MAIN({ret = ((int (*)(void)) data)();});
thc_done();
preempt_enable();
local_irq_enable();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment