diff --git a/src/asmjit/core/func.h b/src/asmjit/core/func.h index 78a41f9..d099555 100644 --- a/src/asmjit/core/func.h +++ b/src/asmjit/core/func.h @@ -1120,6 +1120,15 @@ public: inline uint32_t redZoneSize() const noexcept { return _redZoneSize; } //! Returns the size of 'SpillZone'. inline uint32_t spillZoneSize() const noexcept { return _spillZoneSize; } + + //! Resets the size of red zone, which would disable it entirely. + //! + //! \note Red zone is currently only used by an AMD64 SystemV calling convention, which expects 128 + //! bytes of stack to be accessible below stack pointer. These bytes are then accessible within the + //! function and Compiler can use this space as a spill area. However, sometimes it's better to + //! disallow the use of red zone in case that a user wants to use this stack for a custom purpose. + inline void resetRedZone() noexcept { _redZoneSize = 0; } + //! Returns natural stack alignment (guaranteed stack alignment upon entry). inline uint32_t naturalStackAlignment() const noexcept { return _naturalStackAlignment; } //! Returns natural stack alignment (guaranteed stack alignment upon entry). diff --git a/src/asmjit/core/rastack.cpp b/src/asmjit/core/rastack.cpp index 2b7ed59..318fbde 100644 --- a/src/asmjit/core/rastack.cpp +++ b/src/asmjit/core/rastack.cpp @@ -62,7 +62,7 @@ Error RAStackAllocator::calculateStackFrame() noexcept { // STEP 1: // - // Update usage based on the size of the slot. We boost smaller slots in a way that 32-bit register has higher + // Update usage based on the size of the slot. We boost smaller slots in a way that 32-bit register has a higher // priority than a 128-bit register, however, if one 128-bit register is used 4 times more than some other 32-bit // register it will overweight it. for (RAStackSlot* slot : _slots) {