mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
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:
committed by
Christoffer Lerno
parent
95836e98a2
commit
f180a0d44a
@@ -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};
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user