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

Commit 5f6cf1db authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "disable extractor memory limits under hwasan"

parents 4bc812d4 12db7ff4
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);