-
Notifications
You must be signed in to change notification settings - Fork 76
Add alloc_with_options #1218
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
Add alloc_with_options #1218
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed parts of the doc comments of alloc
, alloc_no_gc
, alloc_slow
and alloc_slow_no_gc
. Particularly, I rewrote the comment of alloc
to make it more ordered.
I changed the documentation based on the suggestions. |
src/memory_manager.rs
Outdated
/// normally without panicking or throwing exceptions, this function will return zero. | ||
/// | ||
/// This function in most cases returns a valid memory address. | ||
/// This function may return a zero address iif 1. MMTk attempts at least one GC, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// This function may return a zero address iif 1. MMTk attempts at least one GC, | |
/// This function may return a zero address if 1. MMTk attempts at least one GC, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually this paragraph should be removed.
large object. Minor fixes for comments
Co-authored-by: Kunshan Wang <wks1986@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
I’m awaiting feedback from @JunmingZhao42 and Ben before merging this PR, as they requested this feature. |
Co-authored-by: Ben Gamari <ben@smart-cactus.org>
I think this PR still looks good now. |
commit 8a6cac2 Author: Yi Lin <qinsoon@gmail.com> Date: Wed May 21 05:36:29 2025 +0000 Implement SpaceInspector for all policies commit 10883f4 Author: Yi Lin <qinsoon@gmail.com> Date: Thu May 15 04:38:07 2025 +0000 Introduce SpaceInspector and RegionInspector commit c5ead72 Author: Yi Lin <qinsoon@gmail.com> Date: Mon May 12 12:42:14 2025 +1200 Choose Non-moving Policy based on features (mmtk#1308) This PR uses an Immix space as the default non moving space, and adds two features to use mark sweep or immortal as the non moving space. * `Mutator` now includes 2 Immix allocators (one for Immix as the default space, and the other for Immix as the non moving space). * Call prepare/release/end_of_gc for the non moving space. * Add `common_prepare_func` and `common_release_func` for mutators. commit 8b32d04 Author: Yi Lin <qinsoon@gmail.com> Date: Fri May 9 17:41:07 2025 +1200 Add alloc_with_options (mmtk#1218) This PR adds an alternative allocation functions `alloc_with_options`. The attached `AllocationOptions` change the allocation behavior, such as avoiding GCs and allowing overcommit. Our current `alloc` functions assume they are GC safe points and will trigger GCs internally. A runtime may have different assumptions. We see GHC has `allocateMightFail` (https://gitlab.haskell.org/ghc/ghc/-/blob/90746a591919fc51a0ec9dec58d8f1c8397040e3/rts/sm/Storage.c?page=2#L1089). Also Julia assumes perm alloc will not trigger a GC (mmtk/mmtk-julia#172). Having a variant of `alloc` that is not GC safepoints could be generally useful. --------- Co-authored-by: Kunshan Wang <wks1986@gmail.com> Co-authored-by: Ben Gamari <ben@smart-cactus.org> commit df7a1f1 Author: Yi Lin <qinsoon@gmail.com> Date: Thu May 8 15:31:41 2025 +1200 Remove V8 tests from extended tests (mmtk#1313) This PR removes V8 tests from our extended tests for mmtk-core. The V8 version we use in the binding is outdated, and the required environments are no longer supported by Github runners. See the discussion in [#ANU Research > The V8 binding is beyond repair @ 💬](https://mmtk.zulipchat.com/#narrow/channel/262677-ANU-Research/topic/The.20V8.20binding.20is.20beyond.20repair/near/509115086).
This PR adds an alternative allocation functions
alloc_with_options
. The attachedAllocationOptions
change the allocation behavior, such as avoiding GCs and allowing overcommit.Our current
alloc
functions assume they are GC safe points and will trigger GCs internally. A runtime may have different assumptions. We see GHC hasallocateMightFail
(https://gitlab.haskell.org/ghc/ghc/-/blob/90746a591919fc51a0ec9dec58d8f1c8397040e3/rts/sm/Storage.c?page=2#L1089). Also Julia assumes perm alloc will not trigger a GC (mmtk/mmtk-julia#172).Having a variant of
alloc
that is not GC safepoints could be generally useful.