0.5.5 features (#1151)

0.5.5 Disallow multiple `_` in a row in digits, e.g. `1__000`. #1138. Fixed toposort example. Struct/union members now correctly rejects members without storage size #1147. `math::pow` will now correctly promote integer arguments. `math::pow` will now correctly promote integer arguments. Added `new_aligned` and `alloc_aligned` functions to prevent accidental under-alignment when allocating simd. Pointer difference would fail where alignment != size (structs etc) #1150. Add test that overalignment actually works for lists. Fixed array calculation for npot2 vectors. Use native aligned alloc on Windows and POSIX. Deprecates "offset". Simplification of the Allocator interface.
This commit is contained in:
Christoffer Lerno
2024-02-22 17:13:51 +01:00
committed by GitHub
parent b7f4fd9074
commit 7ea3d230bb
39 changed files with 749 additions and 310 deletions

2
lib/std/os/linux/heap.c3 Normal file
View File

@@ -0,0 +1,2 @@
module std::os::linux @if(env::LINUX);
extern fn usz malloc_usable_size(void* ptr);

3
lib/std/os/macos/heap.c3 Normal file
View File

@@ -0,0 +1,3 @@
module std::os::darwin @if(env::DARWIN);
extern fn usz malloc_size(void* ptr);

3
lib/std/os/posix/heap.c3 Normal file
View File

@@ -0,0 +1,3 @@
module std::os::posix @if(env::POSIX);
extern fn CInt posix_memalign(void **memptr, usz alignment, usz size);

11
lib/std/os/win32/heap.c3 Normal file
View File

@@ -0,0 +1,11 @@
module std::os::win32 @if(env::WIN32);
extern fn void* _aligned_malloc(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_free(void* memblock);
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_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 usz _msize(void* memblock);