本文共 1668 字,大约阅读时间需要 5 分钟。
??
GC??Java??????????????????????????????Android??????Java????????????????????????????????????native???????Bitmap????????????????????????????native???????????????
????????????GC???????????GC??????????????????????
???native???????????GC
Android?N?????NativeAllocationRegistry????????????GC??Java???????native?????????????????????????Java?????Java??????????????native???????????Java???????native??????????????Java????????????GC???????native??????????????????????????NativeAllocationRegistry??GC????????????native?????????????GC?
??????????GC?????Java???????????native??????????????NativeAllocationRegistry???????Java??native???????????native????????????
???Java???????native????
NativeAllocationRegistry?????Cleaner????????????Cleaner???????????????
????
Bitmap?????NativeAllocationRegistry???native???????????Bitmap?????????
mNativePtr = nativeBitmap; final int allocationByteCount = getAllocationByteCount(); NativeAllocationRegistry registry; if (fromMalloc) { registry = NativeAllocationRegistry.createMalloced(Bitmap.class.getClassLoader(), nativeGetNativeFinalizer(), allocationByteCount); } else { registry = NativeAllocationRegistry.createNonmalloced(Bitmap.class.getClassLoader(), nativeGetNativeFinalizer(), allocationByteCount); } registry.registerNativeAllocation(this, nativeBitmap);
??????????????NativeAllocationRegistry??Java?????native????????????NativeAllocationRegistry???????registerNativeAllocation????????????native????????
??
??????Android-360????????????????????????????????????????APP??????????????????????????PDF??????????Android?????????????721?????????????????Android?????????????????????????
发表评论
最新留言
关于作者