Changeset: 76fd41f2ef30 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=76fd41f2ef30
Modified Files:
gdk/gdk_bat.c
gdk/gdk_batop.c
gdk/gdk_delta.c
gdk/gdk_hash.c
gdk/gdk_hash.h
gdk/gdk_private.h
Branch: default
Log Message:
Removed function HASHremove.
Hashes can only exist on the tail column since the head column is
always VOID, so there is no need to destroy hashes on head columns.
diffs (118 lines):
diff --git a/gdk/gdk_bat.c b/gdk/gdk_bat.c
--- a/gdk/gdk_bat.c
+++ b/gdk/gdk_bat.c
@@ -1155,7 +1155,7 @@ BUNinplace(BAT *b, BUN p, const void *t,
* clear it */
b->T->nil = 0;
}
- HASHremove(b);
+ HASHdestroy(b);
Treplacevalue(b, BUNtloc(bi, p), t);
tt = b->ttype;
diff --git a/gdk/gdk_batop.c b/gdk/gdk_batop.c
--- a/gdk/gdk_batop.c
+++ b/gdk/gdk_batop.c
@@ -408,7 +408,7 @@ BATappend(BAT *b, BAT *n, bit force)
/* if growing too much, remove the hash, else we maintain it */
if (BATcheckhash(b) && (2 * b->T->hash->mask) < (BATcount(b) + sz)) {
- HASHremove(b);
+ HASHdestroy(b);
}
if (b->T->hash != NULL ||
(b->tkey & BOUND2BTRUE) != 0 ||
diff --git a/gdk/gdk_delta.c b/gdk/gdk_delta.c
--- a/gdk/gdk_delta.c
+++ b/gdk/gdk_delta.c
@@ -167,7 +167,7 @@ BATundo(BAT *b)
BATkey(b, FALSE);
if (b->tkey)
BATkey(BATmirror(b), FALSE);
- HASHremove(b);
+ HASHdestroy(b);
}
b->batFirst = b->batDeleted;
BATsetcount(b, b->batInserted);
diff --git a/gdk/gdk_hash.c b/gdk/gdk_hash.c
--- a/gdk/gdk_hash.c
+++ b/gdk/gdk_hash.c
@@ -187,8 +187,8 @@ HASHcollisions(BAT *b, Hash *h)
* Note that the b->T->hash pointer can be NULL, meaning there is no
* hash; (Hash *) 1, meaning there is no hash loaded, but it may exist
* on disk; or a valid pointer to a loaded hash. These values are
- * maintained here, in the HASHdestroy/HASHremove and HASHfree
- * functions, and in BBPdiskscan during initialization. */
+ * maintained here, in the HASHdestroy and HASHfree functions, and in
+ * BBPdiskscan during initialization. */
int
BATcheckhash(BAT *b)
{
@@ -323,6 +323,7 @@ BAThash(BAT *b, BUN masksize)
{
lng t0 = 0, t1 = 0;
+ assert(b->batCacheid > 0);
if (BATcheckhash(b)) {
return GDK_SUCCEED;
}
@@ -565,7 +566,7 @@ HASHlist(Hash *h, BUN i)
}
void
-HASHremove(BAT *b)
+HASHdestroy(BAT *b)
{
if (b) {
if (b->T->hash == (Hash *) 1) {
@@ -582,7 +583,7 @@ HASHremove(BAT *b)
if ((!hp || b->T->hash != hp->T->hash) && b->T->hash !=
(Hash *) -1) {
ALGODEBUG if (*(size_t *)
b->T->hash->heap->base & (1 << 24))
- fprintf(stderr, "#HASHremove: removing
persisted hash %d\n", b->batCacheid);
+ fprintf(stderr, "#HASHdestroy: removing
persisted hash %d\n", b->batCacheid);
HEAPfree(b->T->hash->heap, 1);
GDKfree(b->T->hash->heap);
GDKfree(b->T->hash);
@@ -593,17 +594,6 @@ HASHremove(BAT *b)
}
void
-HASHdestroy(BAT *b)
-{
- if (b) {
- HASHremove(b);
- if (BATmirror(b))
- HASHremove(BATmirror(b));
-
- }
-}
-
-void
HASHfree(BAT *b)
{
if (b) {
diff --git a/gdk/gdk_hash.h b/gdk/gdk_hash.h
--- a/gdk/gdk_hash.h
+++ b/gdk/gdk_hash.h
@@ -218,7 +218,7 @@ gdk_export BUN HASHlist(Hash *h, BUN i);
do { \
if ((b)->T->hash == (Hash *) 1 || \
(((i) & 1023) == 1023 && HASHgonebad((b), (v)))) { \
- HASHremove(b); \
+ HASHdestroy(b); \
} else { \
BUN _c = HASHprobe((b)->T->hash, (v)); \
HASHputall((b)->T->hash, (i), _c); \
diff --git a/gdk/gdk_private.h b/gdk/gdk_private.h
--- a/gdk/gdk_private.h
+++ b/gdk/gdk_private.h
@@ -151,8 +151,6 @@ void BBPdump(void); /* never called: fo
__attribute__((__visibility__("hidden")));
__hidden Hash *HASHnew(Heap *hp, int tpe, BUN size, BUN mask, BUN count)
__attribute__((__visibility__("hidden")));
-__hidden void HASHremove(BAT *b)
- __attribute__((__visibility__("hidden")));
__hidden gdk_return HEAPalloc(Heap *h, size_t nitems, size_t itemsize)
__attribute__((__visibility__("hidden")));
__hidden gdk_return HEAPcopy(Heap *dst, Heap *src)
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list