Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0aef8ce6 authored by Jeffrey Vander Stoep's avatar Jeffrey Vander Stoep Committed by android-build-merger
Browse files

Merge "mediaextractor: Skip setting memory limits on ASan builds" am: da1ce7f9 am: 41e71e5c

am: ff39fd1e

Change-Id: I53c2d8c27635002ce3ba387983e9a4c3d14cc725
parents b578ed0b ff39fd1e
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -31,6 +31,11 @@ void limitProcessMemory(
    size_t numberOfBytes,
    size_t percentageOfTotalMem) {

    if (running_with_asan()) {
        ALOGW("Running with ASan, skip enforcing memory limitations.");
        return;
    }

    long pageSize = sysconf(_SC_PAGESIZE);
    long numPages = sysconf(_SC_PHYS_PAGES);
    size_t maxMem = SIZE_MAX;
+6 −0
Original line number Diff line number Diff line
@@ -19,6 +19,12 @@

namespace android {

extern "C" void __asan_init(void) __attribute__((weak));

static inline int running_with_asan() {
    return &__asan_init != 0;
}

/**
   Limit the amount of memory a process can allocate using setrlimit(RLIMIT_AS).
   The value to use will be read from the specified system property, or if the