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

Wasmvm memory management implementation #53

Merged
merged 8 commits into from
Dec 5, 2020

Conversation

JoeyTeng
Copy link

#18

add a new global metadata field to save the end address of remainder
block
implementation of malloc/free for fast_bins
@JoeyTeng JoeyTeng added the enhancement New feature or request label Oct 31, 2020
@JoeyTeng JoeyTeng added this to the deeplang 1.0 milestone Oct 31, 2020
@JoeyTeng JoeyTeng self-assigned this Oct 31, 2020
feat: add pseudo-random number generator for vm
integrate new source files into Makefile
update design doc
- use pointers instead of offsets for fast bins
- add a head block for sorted-block skiplist
  - update mem_init accordingly
implemented malloc and free for sorted_bins
@JoeyTeng
Copy link
Author

Implement malloc and free without any tests.

TODO:

  • Implement realloc and migrate
  • Implement pool stats
  • Test implementations
  • Adapt for 64-bit system naturally

NOTE: There are some amendments to the original design doc.

- Offset calculation error, as the plain pointer arithmatics are not in
  bytes;
- Refer to payload wrongly: should refer to its address, not the address
  it point to;
- Add a NULL check;
@JoeyTeng JoeyTeng marked this pull request as ready for review December 3, 2020 13:16
@JoeyTeng JoeyTeng requested a review from chinesebear December 3, 2020 13:16
@JoeyTeng
Copy link
Author

JoeyTeng commented Dec 3, 2020

Some minimal tests are done, and the bugs spotted have been fixed.

@chinesebear
Copy link
Contributor

LGTM

@chinesebear chinesebear merged commit c263e35 into wasmvm Dec 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants