Loading ravenwood/libcore-fake/libcore/util/NativeAllocationRegistry.java +6 −0 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ import java.lang.ref.Reference; public class NativeAllocationRegistry { private final long mFreeFunction; private static final Cleaner sCleaner = Cleaner.create(); private static final long DEFAULT_SIZE = 98; public static NativeAllocationRegistry createNonmalloced( ClassLoader classLoader, long freeFunction, long size) { Loading @@ -55,6 +56,11 @@ public class NativeAllocationRegistry { return new NativeAllocationRegistry(clazz.getClassLoader(), freeFunction, size); } public static NativeAllocationRegistry createMalloced( Class clazz, long freeFunction) { return new NativeAllocationRegistry(clazz.getClassLoader(), freeFunction, DEFAULT_SIZE); } public NativeAllocationRegistry(ClassLoader classLoader, long freeFunction, long size) { if (size < 0) { throw new IllegalArgumentException("Invalid native allocation size: " + size); Loading Loading
ravenwood/libcore-fake/libcore/util/NativeAllocationRegistry.java +6 −0 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ import java.lang.ref.Reference; public class NativeAllocationRegistry { private final long mFreeFunction; private static final Cleaner sCleaner = Cleaner.create(); private static final long DEFAULT_SIZE = 98; public static NativeAllocationRegistry createNonmalloced( ClassLoader classLoader, long freeFunction, long size) { Loading @@ -55,6 +56,11 @@ public class NativeAllocationRegistry { return new NativeAllocationRegistry(clazz.getClassLoader(), freeFunction, size); } public static NativeAllocationRegistry createMalloced( Class clazz, long freeFunction) { return new NativeAllocationRegistry(clazz.getClassLoader(), freeFunction, DEFAULT_SIZE); } public NativeAllocationRegistry(ClassLoader classLoader, long freeFunction, long size) { if (size < 0) { throw new IllegalArgumentException("Invalid native allocation size: " + size); Loading