From 3803473b74413f7bc62e947e7a7f1a8303fcee6b Mon Sep 17 00:00:00 2001
From: X512 <danger_mail@list.ru>
Date: Sat, 17 Aug 2019 15:31:35 +0900
Subject: [PATCH 1/1] fix rpmalloc crash when no more memory
---
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 9dd58108f3..e640778e94 100644
a
|
b
|
_memory_allocate_from_heap_fallback(heap_t* heap, uint32_t class_idx) {
|
1350 | 1350 | |
1351 | 1351 | //Find a span in one of the cache levels |
1352 | 1352 | active_span = _memory_heap_extract_new_span(heap, 1, class_idx); |
| 1353 | |
| 1354 | if (active_span == 0) return 0; |
1353 | 1355 | |
1354 | 1356 | //Mark span as owned by this heap and set base data, return first block |
1355 | 1357 | return _memory_span_set_new_active(heap, heap_class, active_span, class_idx); |