Skip to content

Commit

Permalink
investigation step
Browse files Browse the repository at this point in the history
  • Loading branch information
mertcandav committed Aug 30, 2024
1 parent 5837aae commit f84bead
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions api/fn.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -240,19 +240,23 @@ namespace jule
#ifdef OS_WINDOWS
void __closure_init(void) noexcept
{
printf("in");
jule::__closure_mtx_init();
printf("in2");
SYSTEM_INFO si;
GetNativeSystemInfo(&si);
const uint32_t page_size = si.dwPageSize * (((__JULE_ASSUMED_PAGE_SIZE - 1) / si.dwPageSize) + 1);
jule::__page_size = page_size;
jule::__closure_alloc();
DWORD temp;
printf("in3");
VirtualProtect(jule::__closure_ptr, page_size, PAGE_READWRITE, &temp);
(void)memcpy(jule::__closure_ptr, jule::__closure_get_ctx_bytes, sizeof(jule::__closure_get_ctx_bytes));
VirtualProtect(jule::__closure_ptr, page_size, PAGE_EXECUTE_READ, &temp);
jule::__closure_get_ctx = (void *(*)(void))jule::__closure_ptr;
jule::__closure_ptr += __JULE_CLOSURE_SIZE;
jule::__closure_cap--;
printf("out");
}
#else
void __closure_init(void) noexcept
Expand Down

0 comments on commit f84bead

Please sign in to comment.