Created
June 24, 2020 20:44
-
-
Save tenderlove/5696f47310fd442f11fbb99a4f716066 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
page_body = (struct heap_page_body *)rb_aligned_malloc(HEAP_PAGE_ALIGN, HEAP_PAGE_SIZE); | |
/* cut.. */ | |
page = calloc1(sizeof(struct heap_page)); | |
/* cut.. */ | |
assert((getpagesize() * 4) == HEAP_PAGE_ALIGN); | |
intptr_t page_body_end = (intptr_t)page_body + (getpagesize() * 4); | |
if ((intptr_t)page > (intptr_t)page_body && (intptr_t)page < page_body_end) { | |
rb_bug("heap page shares OS pages with body!"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment