still debugging to no avail
authorglenrendes <glenda@reasoningtechnology.com>
Tue, 29 Oct 2019 17:39:06 +0000 (18:39 +0100)
committerglenrendes <glenda@reasoningtechnology.com>
Tue, 29 Oct 2019 17:39:06 +0000 (18:39 +0100)
module/da/lib/libda.a
module/da/src/acc.lib.c
module/da/src/da.lib.c
module/da/test/exec/test_da
module/da/test/lib/libtest.a
module/da/test/src/test_da.lib.c

index 7b3adea..137836b 100644 (file)
Binary files a/module/da/lib/libda.a and b/module/da/lib/libda.a differ
index d98f2f9..37ba2f3 100644 (file)
@@ -22,7 +22,7 @@ AccChannel *acc_open(AccChannel *channel, Mode mode){//acc init
 }
 void *acc_malloc(size_t size, AccChannel *channel){
   void *an_allocation_pt = malloc(size);
-  if( channel ) da_push((Da *)(channel->outstanding_malloc), &an_allocation_pt);
+  if( channel ) da_push((Da *)(channel->outstanding_malloc), &an_allocation_pt);//tried taking out reference but fixed nothing
   return (void *)an_allocation_pt;
 }
 void acc_free(void *pt, AccChannel *channel){
index 34d6b68..5bca280 100644 (file)
@@ -96,6 +96,7 @@ char *da_index(Da *dap, size_t i){
 // allocate space for a new element at the end of the array
 static char *da_push_alloc(Da *dap){
   size_t element_off = dap->end - dap->base;
+  //printf("help help help I'm melting!");
   dap->end += dap->element_size;
   if( dap->end > dap->base + dap->size ) da_expand(dap);
   return dap->base + element_off;
index da6f030..def8c1c 100755 (executable)
Binary files a/module/da/test/exec/test_da and b/module/da/test/exec/test_da differ
index c1955ef..6eb3633 100644 (file)
Binary files a/module/da/test/lib/libtest.a and b/module/da/test/lib/libtest.a differ
index 8a41111..7857883 100644 (file)
@@ -881,10 +881,9 @@ bool test_da_accounting_0(){
   AccChannel acc0;
   AccChannel *acc0_pt = acc_open(&acc0, acc_FULL);
 
-  Da da0;
-  Da *dap = (Da *)da_init(&da0, sizeof(int), NULL);
+  //Da da0;
+  //Da *dap = (Da *)da_init(&da0, sizeof(int), NULL); //trying to use acc0_pt results in even more immediate seg fault
   
-
   printf("Outstanding Malloc: %d\n", (int)(acc0_pt->outstanding_malloc));
   printf("Spurious Free: %d\n", (int)(acc0_pt->spurious_free)); 
   acc_report(acc0_pt);