]> granicus.if.org Git - graphviz/commitdiff
fill in some missing Javadoc vmalloc comments
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Fri, 17 Jul 2020 00:17:24 +0000 (17:17 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 25 Jul 2020 18:54:37 +0000 (11:54 -0700)
lib/vmalloc/vmbest.c
lib/vmalloc/vmclose.c
lib/vmalloc/vmopen.c

index e5c0ea84c4b91e2fd24be44bb60ae5e75d9bee66..0f0f7ea2502ae26262638497e931c86f60623b5d 100644 (file)
@@ -39,9 +39,11 @@ static bool make_space(Vmalloc_t *vm) {
   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;
@@ -61,6 +63,12 @@ void *bestalloc(Vmalloc_t *vm, size_t size) {
   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;
 
@@ -88,10 +96,12 @@ int bestfree(Vmalloc_t *vm, void *data) {
   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;
index d300370a15a6c9c8dd224447df412b192d6dfae4..abcc4f9a801ac894d13ad42206bcf62c961f2e99 100644 (file)
 #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;
 
index bf959e07f73fe0ec0737cb142b88bf13479eb957..8e185c876464da63a4a3a874e62e5e3c66efb12e 100644 (file)
 #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;