Skip to content

Commit 005014b

Browse files
committed
perf: allocate full page for address manager
1 parent d9501dd commit 005014b

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

include/REL/Relocation.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -939,7 +939,7 @@ namespace REL
939939
private:
940940
void grow()
941941
{
942-
const std::size_t capacity = _capacity > 0 ? _capacity * 2 : 1;
942+
const std::size_t capacity = (_capacity > 0) ? (_capacity * 2) : (4096 / sizeof(reg_t));
943943
auto buffer = std::make_unique<reg_t[]>(capacity);
944944
std::memcpy(buffer.get(), _buffer.get(), _capacity * sizeof(reg_t));
945945
_buffer.swap(buffer);
@@ -964,7 +964,7 @@ namespace REL
964964
class StaticID
965965
{
966966
public:
967-
operator std::uint64_t() const noexcept { return _cache._address; }
967+
operator std::uintptr_t() const noexcept { return _cache._address; }
968968

969969
private:
970970
struct Cache

0 commit comments

Comments
 (0)