Changeset: fedd10a2ded0 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=fedd10a2ded0 Modified Files: gdk/gdk.h gdk/gdk_align.c gdk/gdk_bat.c gdk/gdk_batop.c gdk/gdk_bbp.c gdk/gdk_heap.c monetdb5/mal/Tests/tst270.stable.out monetdb5/mal/Tests/tst275.stable.out monetdb5/modules/kernel/bat5.c Branch: default Log Message:
Removed maxsize field from Heap structure. diffs (truncated from 308 to 300 lines): diff --git a/gdk/gdk.h b/gdk/gdk.h --- a/gdk/gdk.h +++ b/gdk/gdk.h @@ -637,7 +637,6 @@ typedef enum { } storage_t; typedef struct { - size_t maxsize; /* deprecated: kept equal to size */ size_t free; /* index where free area starts. */ size_t size; /* size of the heap (bytes) */ char *base; /* base pointer in memory. */ diff --git a/gdk/gdk_align.c b/gdk/gdk_align.c --- a/gdk/gdk_align.c +++ b/gdk/gdk_align.c @@ -383,7 +383,7 @@ VIEWhead(BAT *b) bn->T->width = 0; bn->T->heap.parentid = 0; bn->T->hash = NULL; - bn->T->heap.maxsize = bn->T->heap.size = bn->T->heap.free = 0; + bn->T->heap.size = bn->T->heap.free = 0; bn->T->heap.base = NULL; BATseqbase(bm, oid_nil); return bn; @@ -775,8 +775,8 @@ VIEWbounds(BAT *b, BAT *view, BUN l, BUN cnt = h - l; view->H->heap.base = (view->htype) ? BUNhloc(bi, l) : NULL; view->T->heap.base = (view->ttype) ? BUNtloc(bi, l) : NULL; - view->H->heap.maxsize = view->H->heap.size = headsize(view, cnt); - view->T->heap.maxsize = view->T->heap.size = tailsize(view, cnt); + view->H->heap.size = headsize(view, cnt); + view->T->heap.size = tailsize(view, cnt); BATsetcount(view, cnt); BATsetcapacity(view, cnt); } diff --git a/gdk/gdk_bat.c b/gdk/gdk_bat.c --- a/gdk/gdk_bat.c +++ b/gdk/gdk_bat.c @@ -2818,7 +2818,6 @@ BATassertHeadProps(BAT *b) p = BUNfirst(b); q = BUNlast(b); - assert(b->H->heap.size == b->H->heap.maxsize); assert(b->H->heap.free >= headsize(b, BUNlast(b))); if (b->htype != TYPE_void) { assert(b->batCount <= b->batCapacity); diff --git a/gdk/gdk_batop.c b/gdk/gdk_batop.c --- a/gdk/gdk_batop.c +++ b/gdk/gdk_batop.c @@ -794,8 +794,8 @@ BATslice(BAT *b, BUN l, BUN h) bn->batFirst = bn->batDeleted = bn->batInserted = 0; bn->H->heap.base = (bn->htype) ? BUNhloc(bi, l) : NULL; bn->T->heap.base = (bn->ttype) ? BUNtloc(bi, l) : NULL; - bn->H->heap.maxsize = bn->H->heap.size = headsize(bn, cnt); - bn->T->heap.maxsize = bn->T->heap.size = tailsize(bn, cnt); + bn->H->heap.size = headsize(bn, cnt); + bn->T->heap.size = tailsize(bn, cnt); BATsetcount(bn, cnt); BATsetcapacity(bn, cnt); /* diff --git a/gdk/gdk_bbp.c b/gdk/gdk_bbp.c --- a/gdk/gdk_bbp.c +++ b/gdk/gdk_bbp.c @@ -736,7 +736,6 @@ heapinit(COLrec *col, const char *buf, i col->norevsorted = (BUN) norevsorted; col->seq = base < 0 ? oid_nil : (oid) base; col->align = (oid) align; - col->heap.maxsize = (size_t) size; col->heap.free = (size_t) free; col->heap.size = (size_t) size; col->heap.base = NULL; @@ -764,7 +763,6 @@ vheapinit(COLrec *col, const char *buf, "%n", &free, &size, &storage, &n) < 3) GDKfatal("BBPinit: invalid format for BBP.dir\n%s", buf); - col->vheap->maxsize = (size_t) size; col->vheap->free = (size_t) free; col->vheap->size = (size_t) size; col->vheap->base = NULL; diff --git a/gdk/gdk_heap.c b/gdk/gdk_heap.c --- a/gdk/gdk_heap.c +++ b/gdk/gdk_heap.c @@ -262,10 +262,10 @@ HEAPalloc(Heap *h, size_t nitems, size_t struct stat st; h->base = NULL; - h->maxsize = h->size = 1; + h->size = 1; h->copied = 0; if (itemsize) - h->maxsize = h->size = MAX(1, nitems) * itemsize; + h->size = MAX(1, nitems) * itemsize; h->free = 0; /* check for overflow */ @@ -287,8 +287,7 @@ HEAPalloc(Heap *h, size_t nitems, size_t if (h->filename == NULL || (h->size < minsize)) { h->storage = STORE_MEM; h->base = (char *) GDKmallocmax(h->size, &h->size, 0); - h->maxsize = h->size; - HEAPDEBUG fprintf(stderr, "#HEAPalloc " SZFMT " " SZFMT " " PTRFMT "\n", h->size, h->maxsize, PTRFMTCAST h->base); + HEAPDEBUG fprintf(stderr, "#HEAPalloc " SZFMT " " PTRFMT "\n", h->size, PTRFMTCAST h->base); } if (h->filename && h->base == NULL) { char *of = h->filename; @@ -298,7 +297,6 @@ HEAPalloc(Heap *h, size_t nitems, size_t if (stat(nme, &st) != 0) { h->storage = STORE_MMAP; h->base = HEAPcacheFind(&h->size, of, h->storage); - h->maxsize = h->size; h->filename = of; } else { char *ext; @@ -370,7 +368,7 @@ HEAPextend(Heap *h, size_t size) MMAP_READ | MMAP_WRITE, h->base, h->size, size); if (p) { - h->maxsize = h->size = size; + h->size = size; h->base = p; return 0; } @@ -386,7 +384,7 @@ HEAPextend(Heap *h, size_t size) * of anonymous MMAP in GDKmalloc */ int must_mmap = can_mmap && (small_cpy || exceeds_swap || h->newstorage != STORE_MEM || size >= GDK_mem_bigsize); - h->maxsize = h->size = size; + h->size = size; /* try GDKrealloc if the heap size stays within * reasonable limits */ @@ -394,7 +392,6 @@ HEAPextend(Heap *h, size_t size) void *p = h->base; h->newstorage = h->storage = STORE_MEM; h->base = GDKreallocmax(h->base, size, &h->size, 0); - h->maxsize = h->size; HEAPDEBUG fprintf(stderr, "#HEAPextend: extending malloced heap " SZFMT " " SZFMT " " PTRFMT " " PTRFMT "\n", size, h->size, PTRFMTCAST p, PTRFMTCAST h->base); if (h->base) return 0; @@ -425,7 +422,6 @@ HEAPextend(Heap *h, size_t size) sprintf(h->filename, "%s.%s", nme, ext); h->base = HEAPcacheFind(&h->size, h->filename, STORE_MMAP); if (h->base) { - h->maxsize = h->size; h->newstorage = h->storage = STORE_MMAP; memcpy(h->base, bak.base, bak.free); HEAPfree(&bak); @@ -595,7 +591,7 @@ HEAPfree_(Heap *h, int free_file) { if (h->base) { if (h->storage == STORE_MEM) { /* plain memory */ - HEAPDEBUG fprintf(stderr, "#HEAPfree " SZFMT " " SZFMT " " PTRFMT "\n", h->size, h->maxsize, PTRFMTCAST h->base); + HEAPDEBUG fprintf(stderr, "#HEAPfree " SZFMT " " PTRFMT "\n", h->size, PTRFMTCAST h->base); GDKfree(h->base); } else { /* mapped file, or STORE_PRIV */ int ret = HEAPcacheAdd(h->base, h->size, h->filename, h->storage, free_file); @@ -642,7 +638,6 @@ HEAPload_intern(Heap *h, const char *nme struct stat st; h->storage = h->newstorage; - h->maxsize = h->size; if (h->filename == NULL) h->filename = (char *) GDKmalloc(strlen(nme) + strlen(ext) + 2); if (h->filename == NULL) @@ -652,7 +647,7 @@ HEAPload_intern(Heap *h, const char *nme /* round up mmap heap sizes to REMAP_PAGE_MAXSIZE (usually * 512KB) segments */ if (h->storage != STORE_MEM && minsize != h->size) - h->maxsize = h->size = minsize; + h->size = minsize; /* when a bat is made read-only, we can truncate any unused * space at the end of the heap */ @@ -663,7 +658,7 @@ HEAPload_intern(Heap *h, const char *nme HEAPDEBUG fprintf(stderr, "#ftruncate(file=%s.%s, size=" SZFMT ") = %d\n", nme, ext, truncsize, ret); close(fd); if (ret == 0) { - h->size = h->maxsize = truncsize; + h->size = truncsize; desc_status = 1; } } diff --git a/monetdb5/mal/Tests/tst270.stable.out b/monetdb5/mal/Tests/tst270.stable.out --- a/monetdb5/mal/Tests/tst270.stable.out +++ b/monetdb5/mal/Tests/tst270.stable.out @@ -95,9 +95,9 @@ end main; #-------------------------------------------------# # h t t # name # oid str str # type -#-------------------------------------------------# -[ 0@0, "batId", "tmp_665" ] -[ 1@0, "batCacheid", "437" ] +#--------------------------# +[ 0@0, "batId", "tmp_537" ] +[ 1@0, "batCacheid", "351" ] [ 2@0, "hparentid", "0" ] [ 3@0, "tparentid", "0" ] [ 4@0, "batSharecnt", "0" ] @@ -146,27 +146,25 @@ end main; [ 47@0, "batFirst", "0" ] [ 48@0, "htop", "0" ] [ 49@0, "ttop", "0" ] -[ 50@0, "batStamp", "224" ] -[ 51@0, "lastUsed", "21615" ] -[ 52@0, "curStamp", "226" ] +[ 50@0, "batStamp", "557" ] +[ 51@0, "lastUsed", "33068" ] +[ 52@0, "curStamp", "559" ] [ 53@0, "batCopiedtodisk", "0" ] [ 54@0, "batDirtydesc", "dirty" ] [ 55@0, "H->heap.dirty", "clean" ] [ 56@0, "T->heap.dirty", "clean" ] [ 57@0, "head.free", "0" ] [ 58@0, "head.size", "0" ] -[ 59@0, "head.maxsize", "0" ] -[ 60@0, "head.storage", "absent" ] -[ 61@0, "head.newstorage", "malloced" ] -[ 62@0, "head.filename", "no file" ] -[ 63@0, "tail.free", "0" ] -[ 64@0, "tail.size", "1024" ] -[ 65@0, "tail.maxsize", "1024" ] -[ 66@0, "tail.storage", "malloced" ] -[ 67@0, "tail.newstorage", "malloced" ] -[ 68@0, "tail.filename", "06/665.tail" ] -[ 69@0, "H->vheap->dirty", "clean" ] -[ 70@0, "T->vheap->dirty", "clean" ] +[ 59@0, "head.storage", "absent" ] +[ 60@0, "head.newstorage", "malloced" ] +[ 61@0, "head.filename", "no file" ] +[ 62@0, "tail.free", "0" ] +[ 63@0, "tail.size", "1024" ] +[ 64@0, "tail.storage", "malloced" ] +[ 65@0, "tail.newstorage", "malloced" ] +[ 66@0, "tail.filename", "05/537.tail" ] +[ 67@0, "H->vheap->dirty", "clean" ] +[ 68@0, "T->vheap->dirty", "clean" ] #~EndVariableOutput~# # Start performance profiling #-----------------# diff --git a/monetdb5/mal/Tests/tst275.stable.out b/monetdb5/mal/Tests/tst275.stable.out --- a/monetdb5/mal/Tests/tst275.stable.out +++ b/monetdb5/mal/Tests/tst275.stable.out @@ -58,9 +58,9 @@ end main; #-------------------------------------------------# # h t t # name # oid str str # type -#-------------------------------------------------# -[ 0@0, "batId", "tmp_657" ] -[ 1@0, "batCacheid", "431" ] +#--------------------------# +[ 0@0, "batId", "tmp_505" ] +[ 1@0, "batCacheid", "325" ] [ 2@0, "hparentid", "0" ] [ 3@0, "tparentid", "0" ] [ 4@0, "batSharecnt", "0" ] @@ -109,27 +109,25 @@ end main; [ 47@0, "batFirst", "0" ] [ 48@0, "htop", "0" ] [ 49@0, "ttop", "0" ] -[ 50@0, "batStamp", "608" ] -[ 51@0, "lastUsed", "23084" ] -[ 52@0, "curStamp", "610" ] +[ 50@0, "batStamp", "927" ] +[ 51@0, "lastUsed", "4063" ] +[ 52@0, "curStamp", "929" ] [ 53@0, "batCopiedtodisk", "0" ] [ 54@0, "batDirtydesc", "dirty" ] [ 55@0, "H->heap.dirty", "clean" ] [ 56@0, "T->heap.dirty", "clean" ] [ 57@0, "head.free", "0" ] [ 58@0, "head.size", "0" ] -[ 59@0, "head.maxsize", "0" ] -[ 60@0, "head.storage", "absent" ] -[ 61@0, "head.newstorage", "malloced" ] -[ 62@0, "head.filename", "no file" ] -[ 63@0, "tail.free", "0" ] -[ 64@0, "tail.size", "1024" ] -[ 65@0, "tail.maxsize", "1024" ] -[ 66@0, "tail.storage", "malloced" ] -[ 67@0, "tail.newstorage", "malloced" ] -[ 68@0, "tail.filename", "06/657.tail" ] -[ 69@0, "H->vheap->dirty", "clean" ] -[ 70@0, "T->vheap->dirty", "clean" ] +[ 59@0, "head.storage", "absent" ] +[ 60@0, "head.newstorage", "malloced" ] +[ 61@0, "head.filename", "no file" ] +[ 62@0, "tail.free", "0" ] +[ 63@0, "tail.size", "1024" ] +[ 64@0, "tail.storage", "malloced" ] +[ 65@0, "tail.newstorage", "malloced" ] +[ 66@0, "tail.filename", "05/505.tail" ] +[ 67@0, "H->vheap->dirty", "clean" ] +[ 68@0, "T->vheap->dirty", "clean" ] #~EndVariableOutput~# #-----------------# # h t # name diff --git a/monetdb5/modules/kernel/bat5.c b/monetdb5/modules/kernel/bat5.c --- a/monetdb5/modules/kernel/bat5.c +++ b/monetdb5/modules/kernel/bat5.c @@ -144,9 +144,6 @@ infoHeap(BAT *bk, BAT*bv, Heap *hp, str strcpy(p, "size"); _______________________________________________ checkin-list mailing list checkin-list@monetdb.org http://mail.monetdb.org/mailman/listinfo/checkin-list