This commit is contained in:
2026-09-07 18:48:16 +08:00
parent 1564716731
commit c945aa211f
138 changed files with 10337 additions and 150 deletions
+7 -1
View File
@@ -71,7 +71,13 @@ void* c_Allocator_Alloc(c_Allocator_t* self, c_size_t nBytes) {
C_STATIC_FORCE_INLINE
void* c_Allocator_Realloc(c_Allocator_t* self, void* ptr, c_size_t nOldSize, c_size_t nNewSize) {
if (!self || !ptr || nNewSize==0 || !self->realloc) return NULL;
if (!self || nNewSize==0) return NULL;
if (ptr==NULL || nOldSize==0) {
return c_Allocator_Alloc(self, nNewSize);
}
if (!self->realloc) return NULL;
return self->realloc(ptr, nOldSize, nNewSize, self->ud);
}