Hey Everyone! As you might already know, I recently left my job at Aker to pursue full-time streaming. The video above covers all the important details.
I'd like to give you guys a little sneak peek at the first commercial software project I'm working on: nwr_mem.h
nwr_mem.h is an stb-style mit/public domain single header C library that will provide custom (user-space) memory allocator building blocks inspired by Andrei Alexandrescu's std.experimental.allocator work in the D programming language. The library will include things such as:
Allocators
- Region
- Kernighan-Ritchie Allocator
- Bitmapped Block
- Buddy Allocator
- Affix Allocator
- Stats Collector
- Quantizer
- Free Tree
- Free List
- Fallback Allocator
- Bucketizer
- Segregator
Additionally, the library is being written as a literate program, and a pdf file describing the design and implementation of the library will be available.
I want people to use and share my software regardless of whether they back me on patreon, which is why nwr_mem.h will be MIT/public domain, but officially I will only be distributing my copies to $5+ patrons. Think of the distribution model as piracy-made-legal!
The first version of nwr_mem.h that I will be releasing will include the first allocator: Region. The api can be seen below:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | NWR_INLINE NWR_DEF _Bool nwr_region_grows_down(nwr_region * r); NWR_INLINE NWR_DEF size_t nwr_region_available(nwr_region * r); NWR_INLINE NWR_DEF _Bool nwr_region_is_empty(nwr_region * r); NWR_INLINE NWR_DEF _Bool nwr_region_is_full(nwr_region * r); NWR_INLINE NWR_DEF _Bool nwr_region_is_subregion(nwr_region * r, void * p, size_t l); NWR_INLINE NWR_DEF _Bool nwr_region_is_inside(nwr_region * r, void * p); NWR_INLINE NWR_DEF _Bool nwr_region_is_alive(nwr_region * r, void * p); NWR_INLINE NWR_DEF _Bool nwr_region_is_subregion_alive(nwr_region * r, void * p, size_t l); NWR_INLINE NWR_DEF void nwr_region_reset(nwr_region * r); NWR_INLINE NWR_DEF _Bool nwr_region_dealloc(nwr_region * r, void * p, size_t l); NWR_DEF nwr_region nwr_region_create(void * ptr, size_t length, const nwr_u32 alignment, const nwr_u32 flags); NWR_DEF void * nwr_region_alloc(nwr_region * region, size_t n); NWR_DEF void * nwr_region_aligned_alloc(nwr_region * region, size_t n, nwr_u32 a); NWR_DEF void * nwr_region_alloc_all(nwr_region * region, size_t * size); NWR_DEF size_t nwr_region_expand(nwr_region * region, void * ptr, size_t length, size_t delta); |
A dedicated topic for the library with more information will be made on the forums when it is ready to be released.
As always, thanks for the support, and stay RISCY!