From 96f1543f96c4d65725df19e5a521fc8a985cf65d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 18 Mar 2026 09:39:53 +0000 Subject: [PATCH 1/3] Initial plan From bd89e7cbe6b4f01fcb3fe06084490672e1f6aa4a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 18 Mar 2026 10:17:24 +0000 Subject: [PATCH 2/3] Fix localloc alignment in FrameDataAllocator to use INTERP_STACK_ALIGNMENT Co-authored-by: radekdoulik <4147484+radekdoulik@users.noreply.github.com> --- src/coreclr/vm/interpframeallocator.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/coreclr/vm/interpframeallocator.cpp b/src/coreclr/vm/interpframeallocator.cpp index cc9513f9b09b78..0805fc83b04172 100644 --- a/src/coreclr/vm/interpframeallocator.cpp +++ b/src/coreclr/vm/interpframeallocator.cpp @@ -3,6 +3,7 @@ #ifdef FEATURE_INTERPRETER +#include #include "interpexec.h" #include "interpframeallocator.h" @@ -14,7 +15,7 @@ FrameDataAllocator::FrameDataFragment::FrameDataFragment(size_t size) size = INTERP_STACK_FRAGMENT_SIZE; } - pFrameStart = (uint8_t*)malloc(size); + pFrameStart = (uint8_t*)VMToOSInterface::AlignedAllocate(INTERP_STACK_ALIGNMENT, size); if (pFrameStart != nullptr) { pFrameEnd = pFrameStart + size; @@ -25,7 +26,7 @@ FrameDataAllocator::FrameDataFragment::FrameDataFragment(size_t size) FrameDataAllocator::FrameDataFragment::~FrameDataFragment() { - free(pFrameStart); + VMToOSInterface::AlignedFree(pFrameStart); } FrameDataAllocator::FrameDataAllocator() @@ -83,7 +84,7 @@ bool FrameDataAllocator::PushInfo(InterpMethodContextFrame *pFrame) void *FrameDataAllocator::Alloc(InterpMethodContextFrame *pFrame, size_t size) { - size = ALIGN_UP(size, sizeof(void*)); + size = ALIGN_UP(size, INTERP_STACK_ALIGNMENT); if (pFirst == nullptr) { From 648462ecce7e902349a6496259f24bf0f7335a0f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 18 Mar 2026 10:55:30 +0000 Subject: [PATCH 3/3] Remove spurious #include from interpframeallocator.cpp Co-authored-by: BrzVlad <4720621+BrzVlad@users.noreply.github.com> --- src/coreclr/vm/interpframeallocator.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/coreclr/vm/interpframeallocator.cpp b/src/coreclr/vm/interpframeallocator.cpp index 0805fc83b04172..5c9a17afe88205 100644 --- a/src/coreclr/vm/interpframeallocator.cpp +++ b/src/coreclr/vm/interpframeallocator.cpp @@ -3,7 +3,6 @@ #ifdef FEATURE_INTERPRETER -#include #include "interpexec.h" #include "interpframeallocator.h"