-
-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Interop.Pointer int64 creation from NativeScript side #921
Comments
@NathanaelA looks like they are using 32bit transformations behind the scenes. At this point I don't think you'll be able to create 64bit pointers from JS. |
This comment was marked as abuse.
This comment was marked as abuse.
I tested and it seems that now you can create a pointer from a 64bit number. console.log(new interop.Pointer(-2));
console.log(new interop.Pointer(-1)); Outputs:
I found another issue, however -- |
The "deleted" value of WeakGCMap's hashing function is -1 and such pointer's cannot be added to the `_pointerToInstance` map. refs #921
This allows for correct serialization of pointers through strings. Which can be used for passing native objects to workers as discussed in #620 (comment). The need for these methods arises from the fact that `toNumber` can't be used for negative pointer values, due to JavaScript's values inability to represent very large and/or negative 64-bit integer values as integers. There is a real-world use-case for the value of `-1` shown in #921
This allows for correct serialization of pointers through strings. Which can be used for passing native objects to workers as discussed in #620 (comment). The need for these methods arises from the fact that `toNumber` can't be used for negative pointer values, due to JavaScript's values inability to represent very large and/or negative 64-bit integer values as integers. There is a real-world use-case for the value of `-1` shown in #921
This allows for correct serialization of pointers through strings. Which can be used for passing native objects to workers as discussed in #620 (comment). The need for these methods arises from the fact that `toNumber` can't be used for negative pointer values, due to JavaScript's values inability to represent very large and/or negative 64-bit integer values as integers. There is a real-world use-case for the value of `-1` shown in #921
Please, provide the following version numbers that your issue occurs with:
3.4.x (Probably 4.x also)
Please, tell us how to recreate the issue in as much detail as possible.
Is there any code involved?
var x = new Interop.Pointer(-1) =
<Pointer: 0xffffffff>
However, returning a pointer from ObjC of -1 =
<Pointer: 0xffffffffffffffff>
Is their some secret to create a Interop.Pointer on the Javascript side that is the full int64 size, as it is a special value in a plugin I'm working on. This is the only piece that I'm having to create a tiny OBJC wrapper for; and I would like to eliminate this wrapper if possible.
The text was updated successfully, but these errors were encountered: