[Monetdb-developers] [Monetdb-checkins] MonetDB/src/gdk gdk_heap.mx, , 1.107, 1.108

Peter Boncz boncz at vectorwise.com
Mon Feb 9 23:50:18 CET 2009


Yes, sorry, this went wrong.

the only intended change was:

> -                     h->storage = STORE_MMAP;
> +                     h->newstorage = STORE_MMAP;

________________________________________
Van: Stefan Manegold [Stefan.Manegold at cwi.nl]
Verzonden: maandag 9 februari 2009 23:40
Aan: monetdb-developers at lists.sourceforge.net
CC: Peter Boncz; Sjoerd Mullender
Onderwerp: Re: [Monetdb-checkins] MonetDB/src/gdk gdk_heap.mx,,1.107,1.108

Peter,

IMHO, this check in does more than the log message suggests; among others,
it appears to me as if this check in undoes some fixes coancerning *.new
files that Sjoerd recently checked in.

Could you please check and comment whether this was/is intended?
Or was there any CVS related "accident"?

Given that also the copyright statement is reverted to a state of last year,
I suspect that an old version of this file has been re-activated, possibly
instead of using CVS commands to revert or replay a former check in?

Thanks in advance!

Stefan


On Thu, Feb 05, 2009 at 03:39:43PM +0000, Peter Boncz wrote:
> Update of /cvsroot/monetdb/MonetDB/src/gdk
> In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv5674
>
> Modified Files:
>       gdk_heap.mx
> Log Message:
> - make large allocs fall back again on mmap
>
>
>
> U gdk_heap.mx
> Index: gdk_heap.mx
> ===================================================================
> RCS file: /cvsroot/monetdb/MonetDB/src/gdk/gdk_heap.mx,v
> retrieving revision 1.107
> retrieving revision 1.108
> diff -u -d -r1.107 -r1.108
> --- gdk_heap.mx       22 Jan 2009 14:47:53 -0000      1.107
> +++ gdk_heap.mx       5 Feb 2009 15:39:41 -0000       1.108
> @@ -12,7 +12,7 @@
>  @'
>  @' The Initial Developer of the Original Code is CWI.
>  @' Portions created by CWI are Copyright (C) 1997-July 2008 CWI.
> -@' Copyright August 2008-2009 MonetDB B.V.
> +@' Copyright August 2008- MonetDB B.V.
>  @' All Rights Reserved.
>
>  @f gdk_heap
> @@ -115,7 +115,7 @@
>               fp = GDKfilelocate(nme, "wb", ext);
>               if (fp != NULL) {
>                       fclose(fp);
> -                     h->storage = STORE_MMAP;
> +                     h->newstorage = STORE_MMAP;
>                       HEAPload(h, nme, ext, FALSE);
>               }
>               GDKfree(of);
> @@ -262,7 +262,7 @@
>  @}
>  @- HEAPload
>
> -If we find file X.new, we move it over X (if present) and open it.
> +If we don find file X.new, we move it over X (if present) and open it.
>
>  This routine initializes the h->filename without deallocating
>  its previous contents.
> @@ -284,7 +284,7 @@
>       if (h->filename == NULL)
>               h->filename = (char *) GDKmalloc(strlen(nme) + strlen(ext) + 2);
>       if (h->filename == NULL)
> -             return -1;
> +         return -1;
>       sprintf(h->filename, "%s.%s", nme, ext);
>
>       /* round up mmap heap sizes to REMAP_PAGE_MAXSIZE (usually 512KB) segments */
> @@ -323,19 +323,21 @@
>       strcpy(p, ".new");
>       ret = stat(dstpath, &st);
>       if (stat(srcpath, &st) == 0) {
> -             int t0;
> -             if (ret == 0) {
> -                     t0 = GDKms();
> +             if (ret) {
> +                     int t0 = GDKms();
>                       ret = unlink(dstpath);
>                       IODEBUG THRprintf(GDKout, "#unlink %s = %d (%dms)\n", dstpath, ret, GDKms() - t0);
>               }
> -             t0 = GDKms();
> -             ret = rename(srcpath, dstpath);
> -             if (ret < 0) {
> -                     GDKsyserror("HEAPload: rename of %s failed\n", srcpath);
> -                     return -1;
> +             if (ret == 0) { /* move X.new to X */
> +                     int t0 = GDKms();
> +                     ret = rename(srcpath, dstpath);
> +                     IODEBUG THRprintf(GDKout, "#rename %s %s = %d (%dms)\n", srcpath, dstpath, ret, GDKms() - t0);
>               }
> -                     IODEBUG THRprintf(GDKout, "#rename %s %s = %d (%dms)\n", srcpath, dstpath, ret, GDKms() - t0);
> +     } else if (ret) { /* legacy: accept .priv files as well */
> +             int t0 = GDKms();
> +             strcpy(p, ".priv");
> +             ret = rename(srcpath, dstpath); /* move X.priv to X */
> +             IODEBUG THRprintf(GDKout, "#rename %s %s = %d (%dms)\n", srcpath, dstpath, ret, GDKms() - t0);
>       }
>
>       h->base = (char *) GDKload(nme, ext, h->free, h->size, h->newstorage);
> @@ -885,13 +887,15 @@
>       /*
>          // Create bitmasks that will hold all valid block positions
>        */
> -     hr->validmask = (int *) GDKzalloc(sizeof(int) * ++nwords);
> -     freemask = (int *) GDKzalloc(sizeof(int) * nwords);
> +     hr->validmask = (int *) GDKmalloc(sizeof(int) * ++nwords);
> +     freemask = (int *) GDKmalloc(sizeof(int) * nwords);
>       if (hr->validmask == NULL || freemask == NULL) {
>               GDKfree(hr->validmask);
>               GDKfree(freemask);
>               return FALSE;
>       }
> +     for (block = 0; block < nwords; block++)
> +             freemask[block] = hr->validmask[block] = 0;
>
>       /*
>          // Walk the freelist; register them in freemask
>
>
> ------------------------------------------------------------------------------
> Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
> software. With Adobe AIR, Ajax developers can use existing skills and code to
> build responsive, highly engaging applications that combine the power of local
> resources and data with the reach of the web. Download the Adobe AIR SDK and
> Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
> _______________________________________________
> Monetdb-checkins mailing list
> Monetdb-checkins at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/monetdb-checkins
>
>
>

--
| Dr. Stefan Manegold | mailto:Stefan.Manegold at cwi.nl |
| CWI,  P.O.Box 94079 | http://www.cwi.nl/~manegold/  |
| 1090 GB Amsterdam   | Tel.: +31 (20) 592-4212       |
| The Netherlands     | Fax : +31 (20) 592-4312       |

No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 8.0.233 / Virus Database: 270.10.18/1935 - Release Date: 02/04/09 16:35:00




More information about the developers-list mailing list