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

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

patch for large allocations

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

    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) {  
    13941394
    13951395    //Find a span in one of the cache levels
    13961396    span_t* span = _memory_heap_extract_new_span(heap, span_count, SIZE_CLASS_COUNT);
     1397   
     1398    if (span == 0) return 0;
    13971399
    13981400    //Mark span as owned by this heap and set base data
    13991401    assert(span->span_count == span_count);