Change anyerror { i64, i64 } -> i64. Cleaned up platform data and max tls / vector align. Initial work on bitstruct (just parsing). Updated try / catch semantics.

This commit is contained in:
Christoffer Lerno
2021-08-12 01:08:22 +02:00
committed by Christoffer Lerno
parent 95836e98a2
commit f180a0d44a
63 changed files with 2572 additions and 1124 deletions

View File

@@ -9,6 +9,6 @@ enum CompilerOptLevel
}
const CompilerOptLevel COMPILER_OPT_LEVEL = (CompilerOptLevel)(${COMPILER_OPT_LEVEL});
const bool LITTLE_ENDIAN = ${PLATFORM_LITTLE_ENDIAN};
const bool BIG_ENDIAN = ${PLATFORM_BIG_ENDIAN};
const bool I128_SUPPORT = ${PLATFORM_I128_SUPPORTED};
const bool COMPILER_SAFE_MODE = ${COMPILER_SAFE_MODE};

View File

@@ -11,14 +11,10 @@ enum AllocationKind
REALLOC,
FREE,
}
enum AllocationFailureKind
{
OUT_OF_MEMORY
}
errtype AllocationFailure
{
AllocationFailureKind failureKind;
OUT_OF_MEMORY
}
define AllocatorFunction = func void!(void *data, void** pointer, usize bytes, usize alignment, AllocationKind kind);
@@ -35,12 +31,12 @@ func void! system_malloc_function(void *unused, void** pointer, usize bytes, usi
{
case ALLOC:
void* data = _malloc(bytes);
if (!data) return AllocationFailure({ OUT_OF_MEMORY })!;
if (!data) return AllocationFailure.OUT_OF_MEMORY!;
*pointer = data;
return;
case REALLOC:
void* data = _realloc(*pointer, bytes);
if (!data) return AllocationFailure({ OUT_OF_MEMORY })!;
if (!data) return AllocationFailure.OUT_OF_MEMORY!;
*pointer = data;
return;
case FREE: