projects
/
c11tester.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1a014a3
)
common: introduce userMalloc() and userFree()
author
Brian Norris
<banorris@uci.edu>
Tue, 24 Apr 2012 20:22:38 +0000
(13:22 -0700)
committer
Brian Norris
<banorris@uci.edu>
Tue, 24 Apr 2012 20:22:38 +0000
(13:22 -0700)
These are stubs for now, but I will need these.
common.h
patch
|
blob
|
history
threads.cc
patch
|
blob
|
history
diff --git
a/common.h
b/common.h
index 1570a32969a72902cd3ba5569f2413f6b709a062..0da662aa69e80fddc5f9c383c1656a43969e6d4d 100644
(file)
--- 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 456414d5b3200ec1ca8b7603834e78c761910b76..a4ea252a2342e072385e10773a11008392eb1990 100644
(file)
--- a/
threads.cc
+++ b/
threads.cc
@@
-12,12
+12,12
@@
static void * stack_allocate(size_t size)
{
- return
m
alloc(size);
+ return
userM
alloc(size);
}
static void stack_free(void *stack)
{
-
f
ree(stack);
+
userF
ree(stack);
}
Thread * thread_current(void)