Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/coreclr/vm/codeman.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2412,6 +2412,11 @@ HeapList* EEJitManager::NewCodeHeap(CodeHeapRequestInfo *pInfo, DomainCodeHeapLi
#endif

size_t reserveSize = initialRequestSize;

#if defined(TARGET_AMD64) || defined(TARGET_ARM64)
reserveSize += JUMP_ALLOCATE_SIZE;
#endif

if (reserveSize < minReserveSize)
reserveSize = minReserveSize;
reserveSize = ALIGN_UP(reserveSize, VIRTUAL_ALLOC_RESERVE_GRANULARITY);
Expand Down
5 changes: 5 additions & 0 deletions src/coreclr/vm/dynamicmethod.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,11 @@ HeapList* HostCodeHeap::InitializeHeapList(CodeHeapRequestInfo *pInfo)

// Add TrackAllocation, HeapList and very conservative padding to make sure we have enough for the allocation
ReserveBlockSize += sizeof(TrackAllocation) + HOST_CODEHEAP_SIZE_ALIGN + 0x100;

#if defined(TARGET_AMD64) || defined(TARGET_ARM64)
ReserveBlockSize += JUMP_ALLOCATE_SIZE;
#endif

// reserve ReserveBlockSize rounded-up to VIRTUAL_ALLOC_RESERVE_GRANULARITY of memory
ReserveBlockSize = ALIGN_UP(ReserveBlockSize, VIRTUAL_ALLOC_RESERVE_GRANULARITY);

Expand Down