Changeset: 6546d8569ae9 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=6546d8569ae9
Modified Files:
sql/common/sql_list.c
Branch: Aug2011
Log Message:
use malloc/free for speed
diffs (43 lines):
diff --git a/sql/common/sql_list.c b/sql/common/sql_list.c
--- a/sql/common/sql_list.c
+++ b/sql/common/sql_list.c
@@ -285,7 +285,7 @@ list_keysort(list *l, int *keys, fdup du
node *n = NULL;
int i, j, *pos, cnt = list_length(l);
- pos = (int*)GDKmalloc(cnt*sizeof(int));
+ pos = (int*)malloc(cnt*sizeof(int));
for (n = l->h, i = 0; n; n = n->next, i++) {
pos[i] = i;
}
@@ -296,7 +296,7 @@ list_keysort(list *l, int *keys, fdup du
assert(n);
list_append(res, dup?dup(n->data):n->data);
}
- GDKfree(pos);
+ free(pos);
return res;
}
@@ -307,8 +307,8 @@ list_sort(list *l, fkeyvalue key, fdup d
node *n = NULL;
int i, j, *keys, *pos, cnt = list_length(l);
- keys = (int*)GDKmalloc(cnt*sizeof(int));
- pos = (int*)GDKmalloc(cnt*sizeof(int));
+ keys = (int*)malloc(cnt*sizeof(int));
+ pos = (int*)malloc(cnt*sizeof(int));
for (n = l->h, i = 0; n; n = n->next, i++) {
keys[i] = key(n->data);
pos[i] = i;
@@ -320,8 +320,8 @@ list_sort(list *l, fkeyvalue key, fdup d
assert(n);
list_append(res, dup?dup(n->data):n->data);
}
- GDKfree(keys);
- GDKfree(pos);
+ free(keys);
+ free(pos);
return res;
}
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list