+// SPDX-License-Identifier: GPL-2.0
-#include <xfs/libxfs.h>
+#include "libxfs_priv.h"
/*
* Simple memory interface
if (ptr == NULL) {
fprintf(stderr, _("%s: zone init failed (%s, %d bytes): %s\n"),
- progname, name, (int)sizeof(kmem_zone_t),
+ progname, name, (int)sizeof(kmem_zone_t),
strerror(errno));
exit(1);
}
return ptr;
}
+int
+kmem_zone_destroy(kmem_zone_t *zone)
+{
+ int leaked = 0;
+
+ if (getenv("LIBXFS_LEAK_CHECK") && zone->allocated) {
+ leaked = 1;
+ fprintf(stderr, "zone %s freed with %d items allocated\n",
+ zone->zone_name, zone->allocated);
+ }
+ free(zone);
+ return leaked;
+}
+
void *
kmem_zone_alloc(kmem_zone_t *zone, int flags)
{
}
void *
-kmem_realloc(void *ptr, size_t new_size, size_t old_size, int flags)
+kmem_realloc(void *ptr, size_t new_size, int flags)
{
ptr = realloc(ptr, new_size);
if (ptr == NULL) {
}
return ptr;
}
-