[libc-commits] [libc] [libc] Efficiently implement 'realloc' for AMDGPU devices (PR #145960)
Joseph Huber via libc-commits
libc-commits at lists.llvm.org
Fri Jun 27 06:14:37 PDT 2025
================
@@ -550,5 +551,26 @@ void deallocate(void *ptr) {
release_slab(slab);
}
+void *reallocate(void *ptr, uint64_t size) {
+ if (ptr == nullptr)
+ return gpu::allocate(size);
+
+ // Non-slab allocations are considered foreign pointers so we fail.
+ if ((reinterpret_cast<uintptr_t>(ptr) & SLAB_ALIGNMENT) == 0)
----------------
jhuber6 wrote:
Good point, can I do that in a follow-up?
https://github.com/llvm/llvm-project/pull/145960
More information about the libc-commits
mailing list