From ee5a8df4c176af0f01dd2c47eecb092167f663f6 Mon Sep 17 00:00:00 2001 From: Brian Norris Date: Tue, 24 Apr 2012 13:22:38 -0700 Subject: [PATCH] common: introduce userMalloc() and userFree() These are stubs for now, but I will need these. --- common.h | 3 +++ threads.cc | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/common.h b/common.h index 1570a32..0da662a 100644 --- a/common.h +++ b/common.h @@ -16,4 +16,7 @@ void * myMalloc(size_t size); void myFree(void *ptr); +#define userMalloc(size) malloc(size) +#define userFree(ptr) free(ptr) + #endif /* __COMMON_H__ */ diff --git a/threads.cc b/threads.cc index 456414d..a4ea252 100644 --- a/threads.cc +++ b/threads.cc @@ -12,12 +12,12 @@ static void * stack_allocate(size_t size) { - return malloc(size); + return userMalloc(size); } static void stack_free(void *stack) { - free(stack); + userFree(stack); } Thread * thread_current(void) -- 2.34.1