From ae8ea4a78b113f67ade93152dc3dee1ded81a219 Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Wed, 8 Feb 2012 20:47:52 -0800 Subject: rt: Add constructors and destructors for stacks --- src/rt/rust_task.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/rt/rust_task.cpp') diff --git a/src/rt/rust_task.cpp b/src/rt/rust_task.cpp index dc8b911778a..32245c5d9cd 100644 --- a/src/rt/rust_task.cpp +++ b/src/rt/rust_task.cpp @@ -538,7 +538,7 @@ void rust_task::free_stack(stk_seg *stk) { LOGPTR(thread, "freeing stk segment", (uintptr_t)stk); total_stack_sz -= user_stack_size(stk); - free(stk); + destroy_stack(this, stk); } void @@ -581,8 +581,8 @@ rust_task::new_stack(size_t requested_sz) { fail(); } - size_t sz = sizeof(stk_seg) + rust_stk_sz + RED_ZONE_SIZE; - stk_seg *new_stk = (stk_seg *)malloc(sz, "stack"); + size_t sz = rust_stk_sz + RED_ZONE_SIZE; + stk_seg *new_stk = create_stack(this, sz); LOGPTR(thread, "new stk", (uintptr_t)new_stk); memset(new_stk, 0, sizeof(stk_seg)); add_stack_canary(new_stk); -- cgit 1.4.1-3-g733a5