Fixed bug in dealloc where it would add to the memory used rather than subtract.
Added a zero-check to source-private get_eng_unit function to prevent dropping the unit to the minimum for a value of 0
Changed padding calculation to happen on every call to get_memory_usage_string rather than on the first call. As a result, it will now use minimum padding and ignore zero components. Merged zone and class name alignment values into one.
Fixed bug where the length of a user class/zone was not accounting for the prefix "USER_" by adding 5 to the result.
Made formatting change where by zone/class is tab indented and the values are double tab indented
Moved builtin memory tag names to top of source file because it didn't like being forward declared. TODO: Revisit this later
Fixed compilation error where the source-local function get_eng_unit did not return the modified value.
Shuffled include order around to fix compilation issues.
Fixed a compilation error where the log level mask was being shadowed by log level index in basalt_log and basalt_write.
Fixed a bug where logger_add_stream was checking the lower 48-bits of the FILE* rather than the upper 16 were zero.
Fixed a bug where logger_add_stream did not mark a stream as allocated in its flags.
Fixed a bug where logger_remove_stream did not check if a stream was allocated.
Addressed warnings of potential saftey issues when logging the prefixes as if they were format strings by having them be format-specified. I suspect this is marginally slower and realistically had no security risk in the first place but was fixed anyway.
Added a very basic window object that essentially just wraps an GLFW window object.
TODO: Set the window userdata pointer to point to its wrapping object
Library:
Added logging and memory modules.
The logging module provides a flexible interface for adding and removing logging streams (think stdout, stderr, a file) and supports ANSI colouring and including the date and time of each log call. Its header also provides several definitions for assertions, each corresponding to a specific log level and some other side effects such as debug_break(), returning, exiting or doing nothing.
The memory module wraps (_)aligned_alloc and free functions and includes memory tagging by class and location and the ability to fetch a formatted string containing this information. This can allow you to narrow down where memory leaks and double frees occur to particular sections within a module. Memory can be aligned to any, 32, 64 or 4096 byte boundaries using this module.