Author: wozniak
Date: 2009-03-31 16:11:55 -0500 (Tue, 31 Mar 2009)
New Revision: 324
Modified:
branches/plug_leaks/code/Makefile.in
branches/plug_leaks/code/configure.ac
branches/plug_leaks/code/src/adts/dpkm_list.c
branches/plug_leaks/code/src/adts/ilist.c
branches/plug_leaks/code/src/adts/itable.c
branches/plug_leaks/code/src/adts/keyvalue.c
branches/plug_leaks/code/src/adts/list.c
branches/plug_leaks/code/src/adts/lru_table.c
branches/plug_leaks/code/src/kda-1/kademlia.c
branches/plug_leaks/code/src/mpi_tools/mpi_tools.h
branches/plug_leaks/code/test/paper1/test01.zsh
Log:
Minors.
Modified: branches/plug_leaks/code/Makefile.in
===================================================================
--- branches/plug_leaks/code/Makefile.in 2009-03-31 20:51:19 UTC (rev 323)
+++ branches/plug_leaks/code/Makefile.in 2009-03-31 21:11:55 UTC (rev 324)
@@ -203,7 +203,7 @@
ifneq ($(OPENSSL_INCLUDE),)
IFLAGS += -I $(OPENSSL_INCLUDE)
endif
-ifneq ($(DMALLOC_INCLUDE),1)
+ifneq ($(DMALLOC_INCLUDE),)
IFLAGS += -I $(DMALLOC_INCLUDE)
endif
Modified: branches/plug_leaks/code/configure.ac
===================================================================
--- branches/plug_leaks/code/configure.ac 2009-03-31 20:51:19 UTC (rev 323)
+++ branches/plug_leaks/code/configure.ac 2009-03-31 21:11:55 UTC (rev 324)
@@ -272,11 +272,11 @@
else
AC_CHECK_FILE(${withval}/include/dmalloc.h,
DMALLOC_LOCATION=${withval}
- AC_SUBST(DMALLOC_LOCATION)
AC_MSG_RESULT([Using dmalloc in ${withval}]),
AC_MSG_ERROR([Could not find dmalloc in ${withval}]))
fi
)
+AC_SUBST(DMALLOC_LOCATION)
dnl PAV configuration needs absolute location of source and build.
dnl Linux-2.6 module needs absolute location of source, and uses the
Modified: branches/plug_leaks/code/src/adts/dpkm_list.c
===================================================================
--- branches/plug_leaks/code/src/adts/dpkm_list.c 2009-03-31 20:51:19 UTC (rev 323)
+++ branches/plug_leaks/code/src/adts/dpkm_list.c 2009-03-31 21:11:55 UTC (rev 324)
@@ -174,7 +174,7 @@
if (target->size == 1)
{
data = target->head->data;
- free(target->head);
+ // free(target->head);
target->head = NULL;
target->tail = NULL;
target->size = 0;
@@ -185,7 +185,7 @@
for (item = target->head; item->next->next;
item = item->next);
data = item->next->data;
- free(item->next);
+ // free(item->next);
item->next = NULL;
target->tail = item;
target->size--;
@@ -357,7 +357,7 @@
int c = cmp(data, item->next->data);
if (c == 0)
{
- free(new_item);
+ // free(new_item);
return NULL;
}
if (c == -1)
@@ -445,7 +445,7 @@
while (item)
{
struct dpkm_list_item* next = item->next;
- free(item);
+ // free(item);
item = next;
}
target->head = NULL;
@@ -492,7 +492,7 @@
if (data == item->data)
{
struct dpkm_list_item* next = item->next;
- free(item);
+ FREE(item);
target->head = next;
if (target->tail == next)
target->tail = NULL;
@@ -508,7 +508,7 @@
struct dpkm_list_item* nextnext = item->next->next;
if (target->tail == item->next)
target->tail = nextnext;
- free(item->next);
+ FREE(item->next);
item->next = nextnext;
target->size--;
return true;
Modified: branches/plug_leaks/code/src/adts/ilist.c
===================================================================
--- branches/plug_leaks/code/src/adts/ilist.c 2009-03-31 20:51:19 UTC (rev 323)
+++ branches/plug_leaks/code/src/adts/ilist.c 2009-03-31 21:11:55 UTC (rev 324)
@@ -471,7 +471,7 @@
/**
Just dump the data pointers.
- @return Allocated memory.
+ @return Allocated memory: 10 * target->size.
*/
char*
ilist_serialize_ptrs(struct ilist* target)
Modified: branches/plug_leaks/code/src/adts/itable.c
===================================================================
--- branches/plug_leaks/code/src/adts/itable.c 2009-03-31 20:51:19 UTC (rev 323)
+++ branches/plug_leaks/code/src/adts/itable.c 2009-03-31 21:11:55 UTC (rev 324)
@@ -157,7 +157,7 @@
int i;
ptr += sprintf(str, "{\n");
- char* s = (char*) malloc(sizeof(char) * size);
+ char* s = (char*) MALLOC(sizeof(char) * size);
for (i = 0; i < target->size; i++)
{
@@ -169,7 +169,7 @@
}
sprintf(ptr, "}\n");
- free(s);
+ FREE(s);
return (ptr-str);
}
Modified: branches/plug_leaks/code/src/adts/keyvalue.c
===================================================================
--- branches/plug_leaks/code/src/adts/keyvalue.c 2009-03-31 20:51:19 UTC (rev 323)
+++ branches/plug_leaks/code/src/adts/keyvalue.c 2009-03-31 21:11:55 UTC (rev 324)
@@ -10,7 +10,7 @@
keyvalue_destroy(struct keyvalue* kv)
{
NOTE_F;
- free(kv->key);
- free(kv->data);
- free(kv);
+ FREE(kv->key);
+ FREE(kv->data);
+ FREE(kv);
}
Modified: branches/plug_leaks/code/src/adts/list.c
===================================================================
--- branches/plug_leaks/code/src/adts/list.c 2009-03-31 20:51:19 UTC (rev 323)
+++ branches/plug_leaks/code/src/adts/list.c 2009-03-31 21:11:55 UTC (rev 324)
@@ -881,7 +881,7 @@
}
sprintf(ptr, "]");
- free(s);
+ // free(s);
return (ptr-str);
}
Modified: branches/plug_leaks/code/src/adts/lru_table.c
===================================================================
--- branches/plug_leaks/code/src/adts/lru_table.c 2009-03-31 20:51:19 UTC (rev 323)
+++ branches/plug_leaks/code/src/adts/lru_table.c 2009-03-31 21:11:55 UTC (rev 324)
@@ -24,7 +24,7 @@
(struct dpkm_list**) MALLOC(sizeof(struct dpkm_list*) * capacity);
if (!new_table->array)
{
- free(new_table);
+ FREE(new_table);
return NULL;
}
Modified: branches/plug_leaks/code/src/kda-1/kademlia.c
===================================================================
--- branches/plug_leaks/code/src/kda-1/kademlia.c 2009-03-31 20:51:19 UTC (rev 323)
+++ branches/plug_leaks/code/src/kda-1/kademlia.c 2009-03-31 21:11:55 UTC (rev 324)
@@ -227,7 +227,7 @@
}
char* s = ilist_serialize_ptrs(result);
NOTE(s);
- free(s);
+ FREE(s);
DONE;
return result;
}
@@ -711,6 +711,7 @@
/**
Locate the object_id and call its host method and args.
+ Copies name but not args onto the heap.
*/
KDA_Operation*
KDA_Operate(KDA_ID object_id, char* name, void* args,
@@ -721,7 +722,7 @@
op->object_id = object_id;
op->unique = ++unique;
- op->name = name;
+ op->name = heap(name);
op->args = args;
op->k_closest = NULL;
op->contacted = inlist_create();
@@ -759,12 +760,11 @@
FREE(op->query);
NOTE("KDA_Operation_free() done");
- /*
- free(op->name);
- if (op->args)
- free(op->args);
- NOTE("NAME ARGS");
- */
+ FREE(op->name);
+
+ // if (op->args)
+ // free(op->args);
+
itable_remove(operations, op->unique);
FREE(op);
@@ -1118,7 +1118,7 @@
FILE* file = fopen(path, "w");
char* result = buckets_tostring();
fprintf(file, result);
- free(result);
+ FREE(result);
fclose(file);
NOTE_S("writing: ", path);
Modified: branches/plug_leaks/code/src/mpi_tools/mpi_tools.h
===================================================================
--- branches/plug_leaks/code/src/mpi_tools/mpi_tools.h 2009-03-31 20:51:19 UTC (rev 323)
+++ branches/plug_leaks/code/src/mpi_tools/mpi_tools.h 2009-03-31 21:11:55 UTC (rev 324)
@@ -279,14 +279,13 @@
#include <dmalloc.h>
#endif
-#define MALLOC(s) malloc(s)
-#define FREE(s) free(s)
-
-/*
+#ifdef ENABLE_DEBUG_MALLOC
#define MALLOC(s) debug_malloc(s)
#define FREE(s) debug_free(s)
#else
-*/
+#define MALLOC(s) malloc(s)
+#define FREE(s) free(s)
+#endif
void* debug_malloc(size_t size);
void debug_free(void* ptr);
Modified: branches/plug_leaks/code/test/paper1/test01.zsh
===================================================================
--- branches/plug_leaks/code/test/paper1/test01.zsh 2009-03-31 20:51:19 UTC (rev 323)
+++ branches/plug_leaks/code/test/paper1/test01.zsh 2009-03-31 21:11:55 UTC (rev 324)
@@ -102,7 +102,7 @@
PUTS=( $( make_sweep 0 ${MAX_PUTS} 2 ) )
ITERATIONS=( {1..${MAX_ITERATION}} )
-make -j 3 D=1 M=1 W=1 TEST01=1 test/paper1/test01.x
+make -j 3 D=1 M=1 TEST01=1 test/paper1/test01.x
[[ $? != 0 ]] && exit 1
# Run parameter sweep