Skip to content

Commit e22c2dc

Browse files
jesse99brson
authored andcommitted
---
yaml --- r: 34143 b: refs/heads/snap-stage3 c: 81805e0 h: refs/heads/master i: 34141: 611bd2c 34139: 166062b 34135: f7b28a1 34127: 9ee8f72 34111: aa1588b v: v3
1 parent 4ef19df commit e22c2dc

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: cd6f24f9d14ac90d167386a56e7a6ac1f0318195
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 0402360abb95b4b9930ac74cf04bb22f343396e1
4+
refs/heads/snap-stage3: 81805e0568706534b8b1d136dc11ee7be001f4cb
55
refs/heads/try: d324a424d8f84b1eb049b12cf34182bda91b0024
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/src/rt/memory_region.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,10 @@ memory_region::realloc(void *mem, size_t orig_size) {
8787

8888
size_t size = orig_size + HEADER_SIZE;
8989
alloc_header *newMem = (alloc_header *)::realloc(alloc, size);
90+
if (newMem == NULL) {
91+
fprintf(stderr, "memory_region::realloc> Out of memory allocating %ld bytes", size);
92+
abort();
93+
}
9094

9195
# if RUSTRT_TRACK_ALLOCATIONS >= 1
9296
assert(newMem->magic == MAGIC);
@@ -118,6 +122,10 @@ memory_region::malloc(size_t size, const char *tag, bool zero) {
118122
size_t old_size = size;
119123
size += HEADER_SIZE;
120124
alloc_header *mem = (alloc_header *)::malloc(size);
125+
if (mem == NULL) {
126+
fprintf(stderr, "memory_region::malloc> Out of memory allocating %ld bytes", size);
127+
abort();
128+
}
121129

122130
# if RUSTRT_TRACK_ALLOCATIONS >= 1
123131
mem->magic = MAGIC;

0 commit comments

Comments
 (0)