Changeset: 6e108baf7828 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=6e108baf7828
Modified Files:
        gdk/gdk_storage.c
Branch: Dec2016
Log Message:

Don't call msync with a length argument that is too long.
In fact, don't do all this complicated stuff to calculate start
address and length, just pass the unaltered heap base as start
address, and the occupied size of the heap as the length.
This should fix bug 6191.


diffs (22 lines):

diff --git a/gdk/gdk_storage.c b/gdk/gdk_storage.c
--- a/gdk/gdk_storage.c
+++ b/gdk/gdk_storage.c
@@ -646,17 +646,8 @@ static void
 BATmsyncImplementation(void *arg)
 {
        Heap *h = ((struct msync *) arg)->h;
-       char *adr;
-       size_t len;
-       size_t offset;
 
-       adr = h->base;
-       offset = ((size_t) adr % MT_pagesize());
-       len = MT_pagesize() * (1 + ((h->base + h->free - adr) / MT_pagesize()));
-       if (offset)
-               adr -= MT_pagesize() - offset;
-       if (len)
-               (void) MT_msync(adr, len);
+       (void) MT_msync(h->base, h->size);
        BBPunfix(((struct msync *) arg)->id);
        GDKfree(arg);
 }
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to