Skip to content
This repository has been archived by the owner on Jun 1, 2023. It is now read-only.

About dvmSetFinalizable #10

Closed
liudongmiao opened this issue May 4, 2014 · 2 comments
Closed

About dvmSetFinalizable #10

liudongmiao opened this issue May 4, 2014 · 2 comments
Labels

Comments

@liudongmiao
Copy link

https://github.com/rovo89/Xposed/blob/b1f0/xposed.cpp#L706

In b1f0, you introduce de_robv_android_xposed_XposedBridge_cloneToSubclassNative, what's the difference with dvmCloneObject?

Currently, I'm intened to use dvmHeapAddRefToLargeTable(&gDvm.gcHeap->finalizableRefs, copy). Do you have some test method for me to test this method?

@rovo89 rovo89 added the question label May 4, 2014
@rovo89
Copy link
Owner

rovo89 commented May 4, 2014

Well, as the name says, the clone can be an instance of a subclass. It also doesn't check whether the object is Cloneable. It's used for XResources (see XposedBridge changes).

I'm calling dvmSetFinalizable because dvmCloneObject calls it. I don't think it is needed where I use it at the moment, but it was easier to keep the methods the same than having to investigate later.

If this isn't available on GB, use whatever dvmCloneObject uses. I would be very careful about gDvm though, it's a huge structure, so there is a bigger risk that the offsets become invalid between the versions or if a vendor added one element to it.

@liudongmiao
Copy link
Author

Got it. After looking into the codes, I have found that for cloning object, the c++ version of dalvik use dvmSetFinalizable, while the c version of dalvik use dvmHeapAddRefToLargeTable via flags.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants