Commit graph

108 commits

Author SHA1 Message Date
Charlie
09553f1e3b Same for sprint and tprint 2024-06-28 21:57:37 +02:00
Charlie
b8ae348ed9 Make print a macro so we don't need to do const_string on fmt strings 2024-06-28 21:39:55 +02:00
Charlie
41795425d0 Build with clang (& fix stuff so it compiles with clang 2024-06-28 19:10:29 +02:00
Charlie
db73d0bd2e - Basic fixed-length string with replacement for C standard printing & fmt stuff
- Jai-like print procedures
	- %s formats 'string' and to format a char* you do %cs
	- It detects if %cs pointer is outside of program memory or stack and asserts
	- AND same for if a char* is passed to %s
	- Print directly writes to stdout without any allocations
	- Basic utlity procedures
	- Buncha string tests
- Beef up assert to display file & line as well
- Don't define memcpy procedures if compiler has intrinsics for them
- Init memory arena for allocations in initialization time before heap is ready (stack memory)
- os_compare_and_swap
- Spinlock "primitive" (wrapper around a bool using compare_and_swap)
- Switched to using spinlock instead of os mutex in heap for synchronization.
- is_pointer_valid() which checks if address is in program_memory or thread stack
2024-06-28 18:50:30 +02:00
Charlie
49ca7f3406 Oogaboogafy main() 2024-06-28 12:16:48 +02:00
Charlie
68d1efb759 - Start work on string library
- Dyamically load minimum crt symbols in os backend so we don't need to #include c headers
- Some more os calls:
	- write to stdout (with our string type)
	- macros for variadic argument lists
	- Dynamic library loading
2024-06-28 12:07:02 +02:00
Charlie
98feda0cbb - build.c which includes everything to be built and configures build with #defines
- Some compile options that make sense for build.bat, and a build_release.bat
- oogabooga:
	- Big buffer program_memory that always has same base address (goodbye serialisation problems)
		- Big buffer grows as needed, crash when out of memory
	- Very sexy platform abstraction & basic os call procedures
	- Heap allocator around the program memory.
    - Jaiyfication (context, context.allocator, push_allocator, temp allocator)
	- Some tests to make sure we ooga the right boogas
2024-06-28 03:28:23 +02:00
randy
d79900449f init 2024-06-27 18:04:21 +07:00