diff --git a/build.py b/build.py index 076fa2a..0d0447d 100755 --- a/build.py +++ b/build.py @@ -261,4 +261,4 @@ if args.test: if target == 'linux': compile([args.test, cia_lib, crt_lib], 'a', '-pie') elif target == 'windows': - compile([args.test, cia_lib, crt_lib], 'a', '-lkernel32.lib') + compile([args.test, cia_lib, crt_lib], 'a.exe', '-lkernel32.lib') diff --git a/src/impl/cia-mem/pool.c b/src/impl/cia-mem/pool.c index 8194d7d..c67c12b 100644 --- a/src/impl/cia-mem/pool.c +++ b/src/impl/cia-mem/pool.c @@ -1,12 +1,11 @@ -static void *_pool_buffer_freelist_add(Cia_Pool *pool, u8 *buffer) { +static void _pool_buffer_freelist_add(Cia_Pool *pool, u8 *buffer) { Cia_Pool_Buffer_Header *header = (Cia_Pool_Buffer_Header *)buffer; u64 header_size = sizeof(Cia_Pool_Buffer_Header); u64 header_size_aligned = cia_size_alignf(header_size, pool->alignment); u8 *buckets = buffer + header_size_aligned; u64 remaining_size = pool->buffer_size - header_size_aligned; u64 buckets_count = remaining_size / pool->bucket_size; - header->free_buckets_count = buckets_count; u64 buckets_size = buckets_count * pool->bucket_size; // Initialize every bucket as free u64 bucket_offset = header_size_aligned + buckets_size; diff --git a/src/impl/stdlib-file/file.c b/src/impl/stdlib-file/file.c index 43ecb85..351bbb9 100644 --- a/src/impl/stdlib-file/file.c +++ b/src/impl/stdlib-file/file.c @@ -8,9 +8,9 @@ static Cia_Pool _file_pool; static void _fileapi_init() { cia_pool_create(&_file_pool, cia_allocator_pages(), 0x1000, sizeof(FILE), 16); - FILE *stdin = cia_pool_alloc(&_file_pool); - FILE *stdout = cia_pool_alloc(&_file_pool); - FILE *stderr = cia_pool_alloc(&_file_pool); + stdin = cia_pool_alloc(&_file_pool); + stdout = cia_pool_alloc(&_file_pool); + stderr = cia_pool_alloc(&_file_pool); _rt_file_std_handles_init(); stdin->rt_file = _rt_file_stdin; stdout->rt_file = _rt_file_stdout; diff --git a/src/windows/tinyrt.c b/src/windows/tinyrt.c index 2b57d33..d58cf65 100644 --- a/src/windows/tinyrt.c +++ b/src/windows/tinyrt.c @@ -83,7 +83,7 @@ static _RT_Status _rt_mem_alloc(void *optional_desired_addr, u64 min_size, void return _RT_STATUS_OK; } -static _RT_Status _rt_mem_free(void *addr) { +static _RT_Status _rt_mem_free(void *addr, u64 size) { BOOL ok = VirtualFree(addr, 0, MEM_RELEASE); if(!ok) { return _RT_ERROR_GENERIC;