mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Fix aligned alloc for Win32 targets.
This commit is contained in:
@@ -79,7 +79,7 @@ fn void*! LibcAllocator.acquire(&self, usz bytes, AllocInitType init_type, usz a
|
|||||||
{
|
{
|
||||||
if (alignment > 0)
|
if (alignment > 0)
|
||||||
{
|
{
|
||||||
return win32::_aligned_recalloc(null, bytes, alignment) ?: AllocationFailure.OUT_OF_MEMORY?;
|
return win32::_aligned_recalloc(null, 1, bytes, alignment) ?: AllocationFailure.OUT_OF_MEMORY?;
|
||||||
}
|
}
|
||||||
return libc::calloc(1, bytes) ?: AllocationFailure.OUT_OF_MEMORY?;
|
return libc::calloc(1, bytes) ?: AllocationFailure.OUT_OF_MEMORY?;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,10 +2,10 @@ module std::os::win32 @if(env::WIN32);
|
|||||||
|
|
||||||
extern fn void* _aligned_malloc(usz size, usz alignment);
|
extern fn void* _aligned_malloc(usz size, usz alignment);
|
||||||
extern fn void* _aligned_realloc(void* memblock, usz size, usz alignment);
|
extern fn void* _aligned_realloc(void* memblock, usz size, usz alignment);
|
||||||
extern fn void* _aligned_recalloc(void* memblock, usz size, usz alignment);
|
extern fn void* _aligned_recalloc(void* memblock, usz num, usz size, usz alignment);
|
||||||
extern fn void _aligned_free(void* memblock);
|
extern fn void _aligned_free(void* memblock);
|
||||||
extern fn void _aligned_msize(void* memblock, usz alignment, usz offset);
|
extern fn void _aligned_msize(void* memblock, usz alignment, usz offset);
|
||||||
extern fn void* _aligned_offset_malloc(usz size, usz alignment, usz offset);
|
extern fn void* _aligned_offset_malloc(usz size, usz alignment, usz offset);
|
||||||
extern fn void* _aligned_offset_realloc(void* memblock, usz size, usz alignment, usz offset);
|
extern fn void* _aligned_offset_realloc(void* memblock, usz size, usz alignment, usz offset);
|
||||||
extern fn void* _aligned_offset_recalloc(void* memblock, usz size, usz alignment, usz offset);
|
extern fn void* _aligned_offset_recalloc(void* memblock, usz num, usz size, usz alignment, usz offset);
|
||||||
extern fn usz _msize(void* memblock);
|
extern fn usz _msize(void* memblock);
|
||||||
@@ -80,6 +80,7 @@
|
|||||||
- Benchmark / test no longer suppresses debug info. #1364.
|
- Benchmark / test no longer suppresses debug info. #1364.
|
||||||
- Bug when compile time subtracting a distinct type.
|
- Bug when compile time subtracting a distinct type.
|
||||||
- `insert_at` incorrectly prevented inserts at the end of a list.
|
- `insert_at` incorrectly prevented inserts at the end of a list.
|
||||||
|
- Fix aligned alloc for Win32 targets.
|
||||||
|
|
||||||
### Stdlib changes
|
### Stdlib changes
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user