From 830524c9eb751a50b92b121146b3a09e75ffa0f1 Mon Sep 17 00:00:00 2001 From: tobid7 Date: Wed, 26 Nov 2025 11:18:48 +0100 Subject: [PATCH] Add a max_size member func to linearAlloc --- include/amethyst/linearAlloc.hpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/amethyst/linearAlloc.hpp b/include/amethyst/linearAlloc.hpp index ff2098a..c89afc4 100644 --- a/include/amethyst/linearAlloc.hpp +++ b/include/amethyst/linearAlloc.hpp @@ -32,5 +32,9 @@ class linearAllocator { friend bool operator!=(const linearAllocator, const linearAllocator) { return false; } + + // Use linearSpace free as max_size to not allocate out of bounds + // or to b eable to see a crash report screen. + size_t max_size() const noexcept { return linearSpaceFree(); } }; } // namespace amy \ No newline at end of file