projects
/
model-checker.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
mymemory: enforce that user allocations come from user context
[model-checker.git]
/
mymemory.cc
diff --git
a/mymemory.cc
b/mymemory.cc
index ea8670d60ccdf7250307b7ae4bb55bc89f5507c5..c79ad9a47d8f2a6208f6f38853866fa77afdcf64 100644
(file)
--- a/
mymemory.cc
+++ b/
mymemory.cc
@@
-8,6
+8,8
@@
#include "mymemory.h"
#include "snapshot.h"
#include "common.h"
#include "mymemory.h"
#include "snapshot.h"
#include "common.h"
+#include "threads-model.h"
+#include "model.h"
#define REQUESTS_BEFORE_ALLOC 1024
#define REQUESTS_BEFORE_ALLOC 1024
@@
-176,9
+178,11
@@
static void * user_malloc(size_t size)
*/
void *malloc(size_t size)
{
*/
void *malloc(size_t size)
{
- if (user_snapshot_space)
+ if (user_snapshot_space) {
+ /* Only perform user allocations from user context */
+ ASSERT(!model || thread_current());
return user_malloc(size);
return user_malloc(size);
- else
+
}
else
return HandleEarlyAllocationRequest(size);
}
return HandleEarlyAllocationRequest(size);
}