summaryrefslogtreecommitdiff
path: root/headers.c
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2021-09-11 10:04:39 +0300
committerIvan Maidanski <ivmai@mail.ru>2021-09-11 10:04:39 +0300
commit7aadbb5292977562cd63afadcb08e2b436b05e00 (patch)
tree0ffb6b0d3ede40a530659fd7e9d95f13d1906331 /headers.c
parente801bea18fc4c04ec6499083afaebf3e011c2760 (diff)
downloadbdwgc-7aadbb5292977562cd63afadcb08e2b436b05e00.tar.gz
Fix missing scratch_last_end_ptr update (Irix)
* headers.c (GC_scratch_alloc): Update GC_scratch_last_end_ptr even if the first GET_MEM() call fails because of out of memory.
Diffstat (limited to 'headers.c')
-rw-r--r--headers.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/headers.c b/headers.c
index c71449f1..375194c9 100644
--- a/headers.c
+++ b/headers.c
@@ -141,6 +141,8 @@ GC_INNER ptr_t GC_scratch_alloc(size_t bytes)
bytes_to_get = ROUNDUP_PAGESIZE_IF_MMAP(bytes);
result = (ptr_t)GET_MEM(bytes_to_get);
GC_add_to_our_memory(result, bytes_to_get);
+ if (result != NULL)
+ GC_scratch_last_end_ptr = result + bytes;
return result;
}
/* Update scratch area pointers and retry. */