Ticket #15258: 0001-fix-rpmalloc-crash-when-no-more-memory.patch

File 0001-fix-rpmalloc-crash-when-no-more-memory.patch, 958 bytes (added by X512, 5 years ago)

patch

  • src/system/libroot/posix/rpmalloc/rpmalloc.cpp

    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) {  
    13501350
    13511351    //Find a span in one of the cache levels
    13521352    active_span = _memory_heap_extract_new_span(heap, 1, class_idx);
     1353   
     1354    if (active_span == 0) return 0;
    13531355
    13541356    //Mark span as owned by this heap and set base data, return first block
    13551357    return _memory_span_set_new_active(heap, heap_class, active_span, class_idx);