Replace platform-specific mmap with reading the entire .asm file

This commit is contained in:
Rangi42
2025-07-28 15:15:40 -04:00
parent 53949761a7
commit 2341d1ee50
2 changed files with 32 additions and 93 deletions

View File

@@ -13,8 +13,8 @@
#include "platform.hpp" // SSIZE_MAX
// This value is a compromise between `LexerState` allocation performance when `mmap` works, and
// buffering performance when it doesn't/can't (e.g. when piping a file into RGBASM).
// This value is a compromise between `LexerState` allocation performance when reading the entire
// file works, and buffering performance when it doesn't (e.g. when piping a file into RGBASM).
static constexpr size_t LEXER_BUF_SIZE = 64;
// The buffer needs to be large enough for the maximum `lexerState->peek()` lookahead distance
static_assert(LEXER_BUF_SIZE > 1, "Lexer buffer size is too small");