mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
rb_aligned_malloc can return NULL
Looking at gc.c, rb_aligned_malloc contains `return NULL;` so it has to be taken care of. Note however that posix_memalign(3posix) does _not_ set errno.
This commit is contained in:
parent
2c889e9b05
commit
fb495b2928
1 changed files with 3 additions and 0 deletions
|
@ -294,6 +294,9 @@ transient_heap_block_alloc(struct transient_heap* theap)
|
|||
#else
|
||||
if (theap->arena == NULL) {
|
||||
theap->arena = rb_aligned_malloc(TRANSIENT_HEAP_BLOCK_SIZE, TRANSIENT_HEAP_TOTAL_SIZE);
|
||||
if (theap->arena == NULL) {
|
||||
rb_bug("transient_heap_block_alloc: failed\n");
|
||||
}
|
||||
}
|
||||
|
||||
TH_ASSERT(theap->arena_index < TRANSIENT_HEAP_BLOCK_NUM);
|
||||
|
|
Loading…
Reference in a new issue