Skip to content
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

Conflicting explanation of the object header layout. #232

Open
DANser-freelancer opened this issue Dec 4, 2024 · 2 comments
Open

Conflicting explanation of the object header layout. #232

DANser-freelancer opened this issue Dec 4, 2024 · 2 comments

Comments

@DANser-freelancer
Copy link

https://www.assemblyscript.org/runtime.html#memory-layout says mmInfo is at -20 type usize and gcInfo is at -16 type usize. I know usize is platform dependent pointer size so it can be i32 or i64, but the assemblyscript header layout only has 4 bytes of space for both of those.
It's unclear what happens to object headers on different platforms. Does the header stretch? Does it force truncated to i32 pointers?

@CountBleck
Copy link
Member

The provided numbers are correct when compiling with 32-bit memories, which is the only address size AS currently supports. We don't support memory64 yet, to my knowledge. mmInfo is indeed a usize, meaning it will be 8 bytes long in memory64, but gcInfo is a u32, which is 4 bytes long no matter what.

@DANser-freelancer
Copy link
Author

Ok. Would be good to have correct specs on the webite instead of 3 usize with total 12 bytes of space reserved.

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

No branches or pull requests

2 participants