Updated malloc/calloc/realloc/free deprecation of old helper functions. Add checks to prevent incorrect alignment on types when using malloc. Better errors from $assert. Added @deprecated. Fixed issue using named arguments after varargs.

This commit is contained in:
Christoffer Lerno
2023-02-27 14:51:35 +01:00
committed by Christoffer Lerno
parent 8ad8af861e
commit dd4edfb747
28 changed files with 705 additions and 343 deletions

View File

@@ -164,7 +164,7 @@ fn void* callback(void* arg) @private
fn void! NativeThread.create(NativeThread* thread, ThreadFn thread_fn, void* arg)
{
PosixThreadData *thread_data = mem::alloc(PosixThreadData);
PosixThreadData *thread_data = malloc(PosixThreadData);
*thread_data = { .thread_fn = thread_fn, .arg = arg };
if (pthread_create(thread, null, &callback, thread_data) != 0)
{