Skip to content

Commit c374078

Browse files
committed
---
yaml --- r: 14342 b: refs/heads/try c: db62154 h: refs/heads/master v: v3
1 parent d21a26c commit c374078

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
refs/heads/master: 61b1875c16de39c166b0f4d54bba19f9c6777d1a
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
5-
refs/heads/try: d23cd8f52fbfb41844b27c5e65cb620c34c7af59
5+
refs/heads/try: db62154062534a61b618f46d4c8715479ce150af
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105

branches/try/src/rt/memory_region.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ void memory_region::free(void *mem) {
6060

6161
void *
6262
memory_region::realloc(void *mem, size_t orig_size) {
63-
if (_synchronized) { _lock.lock(); }
6463
if (!mem) {
6564
add_alloc();
6665
}
@@ -79,6 +78,7 @@ memory_region::realloc(void *mem, size_t orig_size) {
7978
# endif
8079

8180
# if RUSTRT_TRACK_ALLOCATIONS >= 2
81+
if (_synchronized) { _lock.lock(); }
8282
if (_allocation_list[newMem->index] != alloc) {
8383
printf("at index %d, found %p, expected %p\n",
8484
alloc->index, _allocation_list[alloc->index], alloc);
@@ -91,9 +91,9 @@ memory_region::realloc(void *mem, size_t orig_size) {
9191
// printf("realloc: stored %p at index %d, replacing %p\n",
9292
// newMem, index, mem);
9393
}
94+
if (_synchronized) { _lock.unlock(); }
9495
# endif
9596

96-
if (_synchronized) { _lock.unlock(); }
9797
return get_data(newMem);
9898
}
9999

0 commit comments

Comments
 (0)