[libc-commits] [libc] [libc] Efficiently implement `aligned_alloc`	for AMDGPU (PR #146585)
    Joseph Huber via libc-commits 
    libc-commits at lists.llvm.org
       
    Tue Jul  1 19:00:47 PDT 2025
    
    
  
================
@@ -572,5 +577,28 @@ void *reallocate(void *ptr, uint64_t size) {
   return new_ptr;
 }
 
+void *aligned_allocate(uint64_t alignment, uint64_t size) {
+  // All alignment values must be a non-zero power of two.
+  if (!impl::is_pow2(alignment))
+    return nullptr;
----------------
jhuber6 wrote:
Yeah, the max is 2MiB right now
https://github.com/llvm/llvm-project/pull/146585
    
    
More information about the libc-commits
mailing list