From bced5185085b61c349b1730f4072e60078da2bf6 Mon Sep 17 00:00:00 2001 From: WerWolv Date: Wed, 10 Jul 2024 21:32:55 +0200 Subject: [PATCH] includes/std: Added `std::mem::reached()` for use with while-sized arrays --- includes/std/mem.pat | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/includes/std/mem.pat b/includes/std/mem.pat index 2f5d2f7..84d962a 100644 --- a/includes/std/mem.pat +++ b/includes/std/mem.pat @@ -46,6 +46,15 @@ namespace auto std::mem { return $ >= (std::mem::base_address() + std::mem::size()); }; + /** + Function that returns true if the cursor position is at or beyond the given address + @param address The address to compare against + @return True if the cursor is at or beyond the given address + */ + fn reached(u128 address) { + return $ >= address; + }; + /** Aligns the given value to the given alignment @param alignment The alignment to align to