summaryrefslogtreecommitdiff
path: root/libc/src/stdlib/gpu/aligned_alloc.cpp
AgeCommit message (Collapse)Author
2025-07-02[libc] Efficiently implement `aligned_alloc` for AMDGPU (#146585)Joseph Huber
Summary: This patch uses the actual allocator interface to implement `aligned_alloc`. We do this by simply rounding up the amount allocated. Because of how index calculation works, any offset within an allocated pointer will still map to the same chunk, so we can just adjust internally and it will free all the same.
2024-07-30[libc] Implement placeholder memory functions on the GPU (#101082)Joseph Huber
Summary: These functions are needed for `libc++` to link successfully. We can't implement them well currently, so simply provide some stand-in implementations. `realloc` will currently copy garbage and potentially fault and `aligned_alloc` will work unless your alignment is more than 4K alignment. However, these should work in practice to get tests running. I will write a real allocator soon™.