Added OnStack allocator. Added dirname, basename and extension to path functions.

This commit is contained in:
Christoffer Lerno
2023-03-13 11:51:27 +01:00
parent 4ffeada3c7
commit fb761b0cc5
12 changed files with 395 additions and 17 deletions

View File

@@ -24,12 +24,12 @@ fault NumberConversion
macro String printf(String fmt, ..., Allocator* using = mem::heap())
{
@allocating_pool(using; bool is_temp)
@stack_mem(256; Allocator* mem)
{
DString str;
str.tinit();
str.init(.using = mem);
str.printf(fmt, $vasplat());
return using == is_temp ? str.str() : str.copy_str(using);
return str.copy_str(using);
};
}