mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 20:11:17 +00:00
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:
committed by
Christoffer Lerno
parent
a877d4458c
commit
ddd0497922
@@ -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;
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
module std::core::mem::allocator;
|
||||
|
||||
typedef MemoryAllocFn = fn char[]!(usz);
|
||||
def MemoryAllocFn = fn char[]!(usz);
|
||||
|
||||
struct SimpleHeapAllocator
|
||||
{
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user