Commits

julp  committed a5d292d

* mem_(re)?new macros can't be used here
* macro functions aren't calling the right function

  • Participants
  • Parent commits 3010882

Comments (0)

Files changed (2)

 
     if (total_length >= da->allocated) {
         da->allocated = nearest_power(total_length, DARRAY_MIN_LENGTH);
-        da->data = mem_renew(da->data, da->element_size, da->allocated);
+        da->data = realloc(da->data, da->element_size * da->allocated);
     }
 }
 
     da = mem_new(*da);
     da->element_size = element_size;
     da->allocated = nearest_power(length, DARRAY_MIN_LENGTH);
-    da->data = mem_new_n(da->element_size, da->allocated);
+    da->data = malloc(da->element_size * da->allocated);
     da->length = 0;
 
     return da;
 } DArray;
 
 # define darray_prepend(/*DArray **/ da, value) \
-    darray_prepend((da), &(value), 1)
+    darray_prepend_all((da), &(value), 1)
 
 # define darray_append(/*DArray **/ da, value) \
-    darray_append((da), &(value), 1)
+    darray_append_all((da), &(value), 1)
 
 # define darray_insert(/*DArray **/ da, /*uint*/ offset, value) \
-    darray_insert((da), (offset), &(value), 1)
+    darray_insert_all((da), (offset), &(value), 1)
 
 void darray_append_all(DArray *, const void * const, size_t);
 void darray_clear(DArray *);