if ( !ptr )
return;
+#ifdef SYSLINUX_EFI
+ FreePool(ptr);
+#else
ah = (struct free_arena_header *)
((struct arena_header *)ptr - 1);
#endif
__free_block(ah);
+#endif
/* Here we could insert code to return memory to the system. */
}
dprintf("_malloc(%zu, %u, %u) @ %p = ",
size, heap, tag, __builtin_return_address(0));
+#ifdef SYSLINUX_EFI
+ p = AllocatePool(size);
+#else
if (size) {
/* Add the obligatory arena header, and round up */
size = (size + 2 * sizeof(struct arena_header) - 1) & ARENA_SIZE_MASK;
}
}
}
+#endif
dprintf("%p\n", p);
return p;
void *newptr;
size_t newsize, oldsize, xsize;
+#ifdef SYSLINUX_EFI
+ newptr = AllocatePool(size);
+ memcpy(newptr, ptr, size);
+ FreePool(ptr);
+#else
if (!ptr)
return malloc(size);
return newptr;
}
}
+#endif
}
void *zalloc(size_t size)