void *
ralloc_size(const void *ctx, size_t size)
+{
+ /* ralloc_size was originally implemented using calloc, which meant some
+ * code accidentally relied on its zero filling behavior.
+ *
+ * TODO: Make ralloc_size not zero fill memory, and cleanup any code that
+ * should instead be using rzalloc.
+ */
+ return rzalloc_size(ctx, size);
+}
+
+void *
+rzalloc_size(const void *ctx, size_t size)
{
void *block = calloc(1, size + sizeof(ralloc_header));
ralloc_header *info;
return PTR_FROM_HEADER(info);
}
-void *
-rzalloc_size(const void *ctx, size_t size)
-{
- void *ptr = ralloc_size(ctx, size);
- if (likely(ptr != NULL))
- memset(ptr, 0, size);
- return ptr;
-}
-
/* helper function - assumes ptr != NULL */
static void *
resize(void *ptr, size_t size)