return true;
}
-/**
+/** allocate heap memory
+ *
* @param vm region allocating from
* @param size desired block size
+ * @returns Memory fulfilling the allocation request or NULL on failure
*/
void *bestalloc(Vmalloc_t *vm, size_t size) {
void *p;
return p;
}
+/** free heap memory
+ *
+ * @param vm Region the pointer was originally allocated from
+ * @param data The pointer originally received from vmalloc
+ * @returns 0 on success
+ */
int bestfree(Vmalloc_t *vm, void *data) {
size_t i;
return -1;
}
-/**
+/** resize an area of allocated memory
+ *
* @param vm region allocation from
* @param data old block of data
* @param size new size
+ * @returns Pointer to the newly resized area or NULL on failure
*/
void *bestresize(Vmalloc_t *vm, void *data, size_t size) {
size_t i;
#include "vmalloc.h"
#include <stdlib.h>
-/* Close down a region.
-**
-** Written by Kiem-Phong Vo, kpv@research.att.com, 01/16/94.
-*/
+/** Close down a region.
+ *
+ * @param vm Vmalloc to operate on
+ * @returns 0 on success
+ */
int vmclose(Vmalloc_t *vm) {
int r;
#include "vmalloc.h"
#include <stdlib.h>
-/* Opening a new region of allocation.
-**
-** Written by Kiem-Phong Vo, kpv@research.att.com, 01/16/94.
-*/
-
+/** Open a new region of allocation.
+ *
+ * @returns A newly allocated Vmalloc or NULL on failure
+ */
Vmalloc_t *vmopen(void) {
Vmalloc_t *vm;