Skip to content

[vm/ffi] Make Pointer and DynamicLibrary non-special classes #37310

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

Closed
dcharkes opened this issue Jun 19, 2019 · 2 comments
Closed

[vm/ffi] Make Pointer and DynamicLibrary non-special classes #37310

dcharkes opened this issue Jun 19, 2019 · 2 comments
Labels
area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. library-ffi

Comments

@dcharkes
Copy link
Contributor

dcharkes commented Jun 19, 2019

As discussed with @sjindel-google, we should probably make Pointer a normal (not VM special) class. This doesn't change the public API of the FFI in any way, but simplifies its implementation.

Historically Pointer was implemented this way as it was modeled after TypedData, but we only the actual integer address to do special things in the VM (when loading and storing data and when doing foreign calls). Loading the address from the Pointer (or storing it in a new Pointer) does not need to be special in any way.

Edit: idem for DynamicLibrary.

@dcharkes dcharkes added area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. library-ffi labels Jun 19, 2019
@dcharkes dcharkes changed the title [vm/ffi] Make Pointer a non-special class [vm/ffi] Make Pointer and DynamicLibrary non-special classes Jun 20, 2019
@dcharkes
Copy link
Contributor Author

This would enable us to declare nullptr as const and make the fromAddress constructor be used in const expressions.

@dcharkes
Copy link
Contributor Author

This is no longer a goal, because we will share some low level logic between TypedData and Pointer. #40767

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. library-ffi
Projects
None yet
Development

No branches or pull requests

1 participant