Better lowering of distinct types. Noreturn function call expr recognized as a "jump" for escape analysis. Preferring "def" in libs. To upper / to lower for ascii. Initial dynlib support.

This commit is contained in:
Christoffer Lerno
2023-05-21 21:25:33 +02:00
committed by Christoffer Lerno
parent a877d4458c
commit ddd0497922
55 changed files with 579 additions and 416 deletions

View File

@@ -103,7 +103,7 @@ fn void*! ArenaAllocator._alloc(ArenaAllocator* this, usz size, usz alignment, u
usz end = (usz)(aligned_pointer_to_offset - this.data.ptr) + size - offset;
if (end > total_len) return AllocationFailure.OUT_OF_MEMORY?;
this.used = end;
void *mem = aligned_pointer_to_offset - offset;
void* mem = aligned_pointer_to_offset - offset;
ArenaAllocatorHeader* header = mem - ArenaAllocatorHeader.sizeof;
header.size = size;
return mem;

View File

@@ -4,7 +4,7 @@
module std::core::mem::allocator;
typedef MemoryAllocFn = fn char[]!(usz);
def MemoryAllocFn = fn char[]!(usz);
struct SimpleHeapAllocator
{

View File

@@ -5,7 +5,7 @@
module std::core::mem::allocator;
import std::collections::map;
typedef PtrMap = HashMap<uptr, usz>;
def PtrMap = HashMap<uptr, usz>;
// A simple tracking allocator.
// It tracks allocations using a hash map but