Changeset: 5b5f873788f8 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=5b5f873788f8
Modified Files:
        gdk/gdk_imprints.c
Branch: default
Log Message:

Fix off-by-one error.
How true is the comment: TODO: better estimation for the size to
alloc.
Next time, err on the other side, please.


diffs (15 lines):

diff --git a/gdk/gdk_imprints.c b/gdk/gdk_imprints.c
--- a/gdk/gdk_imprints.c
+++ b/gdk/gdk_imprints.c
@@ -682,9 +682,9 @@ do {                                    
                sprintf(imprints->dict->filename, "%s.dict", nme);
 
                /* TODO: better estimation for the size to alloc */
-               if (HEAPalloc(imprints->imps, b->T->heap.size/IMPS_PAGE,
+               if (HEAPalloc(imprints->imps, 
(b->T->heap.size+IMPS_PAGE-1)/IMPS_PAGE,
                                        imprints->bits/8) +
-                       HEAPalloc(imprints->dict, b->T->heap.size/IMPS_PAGE,
+                       HEAPalloc(imprints->dict, 
(b->T->heap.size+IMPS_PAGE-1)/IMPS_PAGE,
                                sizeof(cchdc_t)) < 0) {
                        GDKerror("#BATimprints: memory allocation error");
                        HEAPfree(imprints->bins);
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to