Add "Force a Double Free" button to stress test the tools.

Change-Id: I52bf2f42c9a6040ac345248473d7184b7266f511
This commit is contained in:
Ben Cheng
2013-09-16 12:12:51 -07:00
parent 6fa1156b3b
commit f9e0f5b7cf
6 changed files with 70 additions and 0 deletions

View File

@@ -14,6 +14,7 @@ public class MainActivity extends Activity {
System.loadLibrary("moarram-32");
System.loadLibrary("moarram-2M");
System.loadLibrary("moarram-17_71");
System.loadLibrary("moarram-doublefree");
setContentView(R.layout.activity_main);
}
@@ -55,10 +56,15 @@ public class MainActivity extends Activity {
freeVariableSizedBlocksNative(sizeId == R.id.radio17 ? 0 : 1);
}
public void forceDoubleFree(View view) {
forceDoubleFreeNative();
}
public native void add32ByteBlocksNative();
public native void free32ByteBlocksNative();
public native void add2MByteBlocksNative();
public native void free2MByteBlocksNative();
public native void addVariableSizedBlocksNative(int sizeId);
public native void freeVariableSizedBlocksNative(int sizeId);
public native void forceDoubleFreeNative();
}