Skip to content
Snippets Groups Projects
Commit 39f3281e authored by Reinier Maas's avatar Reinier Maas
Browse files

fixup! Define HEAP_ALLOCED for CMM code

parent 63e3f5bc
No related branches found
No related tags found
No related merge requests found
Pipeline #96257 canceled
......@@ -69,6 +69,9 @@ struct mblock_address_range {
} ATTRIBUTE_ALIGNED(64);
extern struct mblock_address_range mblock_address_space;
// This implementation is duplicated to `Cmm` because performing an `ccall` is relatively high
// compared to the bounds check performed here. If this implementation changes the decisions should
// be reevaluated.
# define HEAP_ALLOCED(p) ((W_)(p) >= mblock_address_space.begin && \
(W_)(p) < (mblock_address_space.end))
# define HEAP_ALLOCED_GC(p) HEAP_ALLOCED(p)
......@@ -79,6 +82,8 @@ extern struct mblock_address_range mblock_address_space;
import mblock_address_space;
// We explicitly duplicate the bound checking implementation of `HEAP_ALLOCED` for performance
// reasons. It doesn't make sense to perform a `ccall` for such a simple implementation.
# define HEAP_ALLOCED(p) ((p) >= W_[mblock_address_space + WDS(0)] && \
(p) < W_[mblock_address_space + WDS(1)])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment