зеркало из https://github.com/github/ruby.git
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:
Родитель
2c889e9b05
Коммит
fb495b2928
|
@ -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);
|
||||
|
|
Загрузка…
Ссылка в новой задаче