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

Commit 98250e93 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "disable extractor memory limits under hwasan" am: 5f6cf1db am: 24131d41

Original change: https://android-review.googlesource.com/c/platform/frameworks/av/+/1543465

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ie5299c437205c34502a69f28d2dd86532f6e718d
parents 35a90e47 24131d41
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -15,6 +15,9 @@
** limitations under the License.
*/

//#define LOG_NDEBUG 0
#define LOG_TAG "main_extractorservice"

#include <fcntl.h>
#include <sys/prctl.h>
#include <sys/wait.h>
@@ -26,6 +29,7 @@

#include <android-base/logging.h>
#include <android-base/properties.h>
#include <utils/Log.h>
#include <utils/misc.h>

// from LOCAL_C_INCLUDES
@@ -41,10 +45,16 @@ static const char kVendorSeccompPolicyPath[] =

int main(int argc __unused, char** argv)
{

#if __has_feature(hwaddress_sanitizer)
    ALOGI("disable media.extractor memory limits (hwasan enabled)");
#else
    ALOGI("enable media.extractor memory limits");
    limitProcessMemory(
        "ro.media.maxmem", /* property that defines limit */
        SIZE_MAX, /* upper limit in bytes */
        20 /* upper limit as percentage of physical RAM */);
#endif

    signal(SIGPIPE, SIG_IGN);