From 9d14ba0541861dcf550c0b6a41a8d98d946d5f0a Mon Sep 17 00:00:00 2001 From: Stenzek Date: Thu, 19 Oct 2023 22:09:07 +1000 Subject: [PATCH] dep/vixl: Add Reset-to-new-buffer overload --- dep/vixl/include/vixl/code-buffer-vixl.h | 1 + dep/vixl/src/code-buffer-vixl.cc | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/dep/vixl/include/vixl/code-buffer-vixl.h b/dep/vixl/include/vixl/code-buffer-vixl.h index d0d815e44..7908dff9b 100644 --- a/dep/vixl/include/vixl/code-buffer-vixl.h +++ b/dep/vixl/include/vixl/code-buffer-vixl.h @@ -43,6 +43,7 @@ class CodeBuffer { ~CodeBuffer(); void Reset(); + void Reset(byte* buffer, size_t capacity); #ifdef VIXL_CODE_BUFFER_MMAP void SetExecutable(); diff --git a/dep/vixl/src/code-buffer-vixl.cc b/dep/vixl/src/code-buffer-vixl.cc index d3f7c7a8f..009441956 100644 --- a/dep/vixl/src/code-buffer-vixl.cc +++ b/dep/vixl/src/code-buffer-vixl.cc @@ -156,6 +156,11 @@ void CodeBuffer::Reset() { SetClean(); } +void CodeBuffer::Reset(byte* buffer, size_t capacity) { + buffer_ = buffer; + cursor_ = buffer; + capacity_ = capacity; +} void CodeBuffer::Grow(size_t new_capacity) { VIXL_ASSERT(managed_);