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

Commit c2b32178 authored by Barry Hayes's avatar Barry Hayes
Browse files

Add a "dalvik.vm.gc.overwritefree" property. When set to "true", the

VM will be given the "-Xgc:overwritefree" flag, and the GC will
clobber the memory of freed objects.
parent 445cc0e4
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -656,6 +656,15 @@ int AndroidRuntime::startVm(JavaVM** pJavaVM, JNIEnv** pEnv)
        }
    }

    /* enable poisoning of memory of freed objects */
    property_get("dalvik.vm.gc.overwritefree", propBuf, "false");
    if (strcmp(propBuf, "true") == 0) {
        opt.optionString = "-Xgc:overwritefree";
        mOptions.add(opt);
    } else if (strcmp(propBuf, "false") != 0) {
        LOGW("dalvik.vm.gc.overwritefree should be 'true' or 'false'");
    }

    /* enable debugging; set suspend=y to pause during VM init */
#ifdef HAVE_ANDROID_OS
    /* use android ADB transport */