projects
/
c11tester.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
69d9b36
)
bug fix
author
bdemsky
<bdemsky@uci.edu>
Wed, 20 Nov 2019 19:56:43 +0000
(11:56 -0800)
committer
bdemsky
<bdemsky@uci.edu>
Wed, 20 Nov 2019 19:56:43 +0000
(11:56 -0800)
datarace.cc
patch
|
blob
|
history
mymemory.cc
patch
|
blob
|
history
diff --git
a/datarace.cc
b/datarace.cc
index be0fc3b6a3fee6803f95d5f6127706cdabb24c27..76fbe936260294b96132cfddc47c605dba3e91ab 100644
(file)
--- a/
datarace.cc
+++ b/
datarace.cc
@@
-676,7
+676,7
@@
void atomraceCheckRead(thread_id_t thread, const void *location)
goto Exit;
}
goto Exit;
}
- if (shadowval &
&
ATOMICMASK)
+ if (shadowval & ATOMICMASK)
return;
{
return;
{
diff --git
a/mymemory.cc
b/mymemory.cc
index 5185cd0f7993e1655aef2619ea275b06fcd401b4..f78e82d567af00313f4cba654d41bff564b1a6bb 100644
(file)
--- a/
mymemory.cc
+++ b/
mymemory.cc
@@
-205,12
+205,15
@@
static void * user_malloc(size_t size)
*/
void *malloc(size_t size)
{
*/
void *malloc(size_t size)
{
+ void *tmp;
if (user_snapshot_space) {
/* Only perform user allocations from user context */
ASSERT(!model || thread_current());
if (user_snapshot_space) {
/* Only perform user allocations from user context */
ASSERT(!model || thread_current());
-
return
user_malloc(size);
+
tmp =
user_malloc(size);
} else
} else
- return HandleEarlyAllocationRequest(size);
+ tmp = HandleEarlyAllocationRequest(size);
+ recordCalloc(tmp, size);
+ return tmp;
}
/** @brief Snapshotting free implementation for user programs */
}
/** @brief Snapshotting free implementation for user programs */
@@
-225,6
+228,7
@@
void free(void * ptr)
void *realloc(void *ptr, size_t size)
{
void *tmp = mspace_realloc(user_snapshot_space, ptr, size);
void *realloc(void *ptr, size_t size)
{
void *tmp = mspace_realloc(user_snapshot_space, ptr, size);
+ recordCalloc(tmp, size);
ASSERT(tmp);
return tmp;
}
ASSERT(tmp);
return tmp;
}
@@
-235,12
+239,12
@@
void * calloc(size_t num, size_t size)
if (user_snapshot_space) {
void *tmp = mspace_calloc(user_snapshot_space, num, size);
ASSERT(tmp);
if (user_snapshot_space) {
void *tmp = mspace_calloc(user_snapshot_space, num, size);
ASSERT(tmp);
- record
Ca
lloc(tmp, num*size);
+ record
A
lloc(tmp, num*size);
return tmp;
} else {
void *tmp = HandleEarlyAllocationRequest(size * num);
memset(tmp, 0, size * num);
return tmp;
} else {
void *tmp = HandleEarlyAllocationRequest(size * num);
memset(tmp, 0, size * num);
- record
Ca
lloc(tmp, num*size);
+ record
A
lloc(tmp, num*size);
return tmp;
}
}
return tmp;
}
}