From f2864ab3306f339bd4db0151d48edc7138b0b870 Mon Sep 17 00:00:00 2001
From: X512 <danger_mail@list.ru>
Date: Sat, 17 Aug 2019 16:15:51 +0900
Subject: [PATCH 1/1] fix rpmalloc crash when no more memory (large alloc size)
---
src/system/libroot/posix/rpmalloc/rpmalloc.cpp | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/system/libroot/posix/rpmalloc/rpmalloc.cpp b/src/system/libroot/posix/rpmalloc/rpmalloc.cpp
index e640778e94..5be8980d35 100644
a
|
b
|
_memory_allocate_large(heap_t* heap, size_t size) {
|
1394 | 1394 | |
1395 | 1395 | //Find a span in one of the cache levels |
1396 | 1396 | span_t* span = _memory_heap_extract_new_span(heap, span_count, SIZE_CLASS_COUNT); |
| 1397 | |
| 1398 | if (span == 0) return 0; |
1397 | 1399 | |
1398 | 1400 | //Mark span as owned by this heap and set base data |
1399 | 1401 | assert(span->span_count == span_count); |