Alot (see description)

- Made a better global allocator for the process.
- Some small fixes to gen.hpp, removed clear_code_memory as I'm designing this library to for now never free any memory.
- Fixes to memory usage for cached strings
- Added missing verification for attributes in some upfront constructors. Added attribute param for def_type procedure.
- Started to use internal and global keywords in gen.cpp for associated definitions
- Progress toward getting the parsing constructors to support operator definitions.
- There was an *attempt* to get parse_type to support parsing function types. Its not tested yet....
  - Its not an nice setup, there is no validation of parameters, problably will add that in the future.
This commit is contained in:
2023-07-09 12:35:48 -04:00
parent 855ba5a965
commit 6da615e6da
8 changed files with 802 additions and 488 deletions

View File

@ -61,6 +61,7 @@ using zpl::EFileMode_WRITE;
using zpl::EFileError_NONE;
using zpl::alloc;
using zpl::alloc_align;
using zpl::arena_allocator;
using zpl::arena_init_from_memory;
using zpl::arena_init_from_allocator;
@ -70,6 +71,8 @@ using zpl::str_fmt_buf;
using zpl::char_first_occurence;
using zpl::char_is_alpha;
using zpl::char_is_alphanumeric;
using zpl::char_is_digit;
using zpl::char_is_hex_digit;
using zpl::char_is_space;
using zpl::crc32;
using zpl::free_all;
@ -564,16 +567,17 @@ char const* Msg_Invalid_Value = "INVALID VALUE PROVIDED";
namespace Memory
{
constexpr uw Initial_Reserve = megabytes(10);
// NOTE: This limits the size of the string that can be read from a file or generated to 10 megs.
// If you are generating a string larger than this, increase the size of the bucket here.
constexpr uw BucketSize = megabytes(10);
extern Arena Global_Arena;
// #define g_allocator arena_allocator( & Memory::Global_Arena)
// Global allocator used for data with process lifetime.
extern AllocatorInfo GlobalAllocator;
// Heap allocator is being used for now to isolate errors from being memory related (tech debt till ready to address)
#define g_allocator heap()
// #define g_allocator heap()
void setup();
void resize( uw new_size );
void cleanup();
}