From a22d535cae669515ce1f80122f5bd7b51f5880c1 Mon Sep 17 00:00:00 2001 From: talha Date: Sat, 10 Aug 2024 10:54:42 +0500 Subject: Updated README with notes --- README.txt | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) (limited to 'README.txt') diff --git a/README.txt b/README.txt index 2568cf1..4bee68d 100644 --- a/README.txt +++ b/README.txt @@ -1,2 +1,32 @@ 1. Introduction -Code libraries built for my personal use. Use with caution... and care. \ No newline at end of file +Code libraries built for my personal use. Use with caution... and care. + +------------------------------ +2. Table of Contents + +a. Memory + - Arena Allocator + - Stack Allocator + +b. String (Under Construction) +------------------------------ + +a. Memory +A simplistic but highly functional helper functions in C. These utilize the concept of allocators to enforce programming +on a clear and simple concept model. For more info on why and how these work, please search online on some data-oriented +videos. + +They are used in a known programming environment, where every allocation is known and is meant to be tracked. Due to +this, while it is possible to cause weird overwrite problems, something that I was quite concerned with for a while, +the reason those won't be a concern is because everything about allocation, and about total allocation capacity is known. + +Q. In what cases would this break? +In specific cases the memory allocators that detect capacity of the buffer can fail to detect if the programmer tries +allocating memory that is larger than int32 in value, but smaller than the available capacity. In this case, since the +amount of memory in int32 will wrap around, it would be indiscernable to the allocation checks if the allocation was +valid or invalid. This would pass the check but eventually fail when allocating and crash the program. + +Q. Why is this not a concern? +This will be used in a known programming environment. Every allocation is meant to be known and tracked. While the +larger than available memory issue will still be possible, the burden of responsibility is on the programmer (me) to +understand that I am not meant to allocate space greater than the size_t (target platform). -- cgit v1.2.3