This does the same thing as dsa_allocate, except that the memory
is guaranteed to be zero-filled on return.
Dilip Kumar, adjusted by me.
return alloc_object(area, size_class);
}
+/*
+ * As dsa_allocate, but zeroes the allocated memory.
+ */
+dsa_pointer
+dsa_allocate0(dsa_area *area, Size size)
+{
+ dsa_pointer dp;
+ char *object;
+
+ dp = dsa_allocate(area, size);
+ object = dsa_get_address(area, dp);
+ memset(object, 0, size);
+
+ return dp;
+}
+
/*
* Free memory obtained with dsa_allocate.
*/
extern Size dsa_minimum_size(void);
extern dsa_handle dsa_get_handle(dsa_area *area);
extern dsa_pointer dsa_allocate(dsa_area *area, Size size);
+extern dsa_pointer dsa_allocate0(dsa_area *area, Size size);
extern void dsa_free(dsa_area *area, dsa_pointer dp);
extern void *dsa_get_address(dsa_area *area, dsa_pointer dp);
extern void dsa_trim(dsa_area *area);