Changeset: b9bcce569e6d for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=b9bcce569e6d Modified Files: clients/Tests/exports.stable.out gdk/ChangeLog gdk/gdk.h gdk/gdk_bat.c Branch: default Log Message:
Removed BATmmap. It was no longer used. diffs (150 lines): diff --git a/clients/Tests/exports.stable.out b/clients/Tests/exports.stable.out --- a/clients/Tests/exports.stable.out +++ b/clients/Tests/exports.stable.out @@ -142,7 +142,6 @@ void *BATmax(BAT *b, void *aggr); size_t BATmemsize(BAT *b, int dirty); BAT *BATmergecand(BAT *a, BAT *b); void *BATmin(BAT *b, void *aggr); -void BATmmap(BAT *b, int hb, int tb, int hh, int th, int force); gdk_return BATmode(BAT *b, int onoff); void BATmsync(BAT *b); int BATname(BAT *b, const char *nme); diff --git a/gdk/ChangeLog b/gdk/ChangeLog --- a/gdk/ChangeLog +++ b/gdk/ChangeLog @@ -1,6 +1,9 @@ # ChangeLog file for MonetDB # This file is updated with Maddlog +* Thu Jan 14 2016 Sjoerd Mullender <[email protected]> +- Removed BATmmap. It was no longer used. + * Fri Dec 18 2015 Sjoerd Mullender <[email protected]> - BUNdelete and BATdel don't accept a foce argument and only allow deleting values that have not yet been committed. BUNdelete exchanges diff --git a/gdk/gdk.h b/gdk/gdk.h --- a/gdk/gdk.h +++ b/gdk/gdk.h @@ -1482,8 +1482,6 @@ gdk_export gdk_return BATgroup(BAT **gro * @item BAT * * @tab BATsave (BAT *b) * @item int - * @tab BATmmap (BAT *b, int hb, int tb, int hh, int th, int force ) - * @item int * @tab BATdelete (BAT *b) * @end multitable * @@ -1498,14 +1496,12 @@ gdk_export gdk_return BATgroup(BAT **gro * * @- Heap Storage Modes * The discriminative storage modes are memory-mapped, compressed, or - * loaded in memory. The @strong{BATmmap()} changes the storage mode - * of each heap associated to a BAT. As can be seen in the bat - * record, each BAT has one BUN-heap (@emph{bn}), and possibly two - * heaps (@emph{hh} and @emph{th}) for variable-sized atoms. + * loaded in memory. As can be seen in the bat record, each BAT has + * one BUN-heap (@emph{bn}), and possibly two heaps (@emph{hh} and + * @emph{th}) for variable-sized atoms. */ gdk_export gdk_return BATsave(BAT *b); -gdk_export void BATmmap(BAT *b, int hb, int tb, int hh, int th, int force); gdk_export void BATmsync(BAT *b); gdk_export size_t BATmemsize(BAT *b, int dirty); diff --git a/gdk/gdk_bat.c b/gdk/gdk_bat.c --- a/gdk/gdk_bat.c +++ b/gdk/gdk_bat.c @@ -1614,77 +1614,6 @@ BATroles(BAT *b, const char *hnme, const } /* - * @- BATmmap - * Changing the storage status of heaps in a BAT is done in BATmmap. - * The new semantics is to do nothing: the new mapping only takes - * effect the next time the bat is loaded or extended. The latter is - * needed for loading large data sets. These transient bats should - * switch cheaply between malloced and memory mapped modes. - * - * We modify the hp->storage fields using HEAPnewstorage and store - * that we want malloced or memory mapped heaps in special binary - * batMap fields that are used when the BAT descriptor is saved. - */ -/* TODO niels: merge with BATsetmodes in gdk_storage */ -#define STORE_MODE(m,r,e,s,f) (((m) == STORE_MEM)?STORE_MEM:((r)&&(e)&&!(f))||(s)==STORE_PRIV?STORE_PRIV:STORE_MMAP) -static void -HEAPnewstorage(BAT *b, int force) -{ - int existing = (BBPstatus(b->batCacheid) & BBPEXISTING); - int brestrict = (b->batRestricted == BAT_WRITE); - - if (b->batMaphead) { - b->H->heap.newstorage = STORE_MODE(b->batMaphead, brestrict, existing, b->H->heap.storage, force); - if (force) - b->H->heap.forcemap = 1; - } - if (b->batMaptail) { - b->T->heap.newstorage = STORE_MODE(b->batMaptail, brestrict, existing, b->T->heap.storage, force); - if (force) - b->T->heap.forcemap = 1; - } - if (b->H->vheap && b->batMaphheap) { - int hrestrict = (b->batRestricted == BAT_APPEND) && ATOMappendpriv(b->htype, b->H->vheap); - b->H->vheap->newstorage = STORE_MODE(b->batMaphheap, brestrict || hrestrict, existing, b->H->vheap->storage, force); - if (force) - b->H->vheap->forcemap = 1; - } - if (b->T->vheap && b->batMaptheap) { - int trestrict = (b->batRestricted == BAT_APPEND) && ATOMappendpriv(b->ttype, b->T->vheap); - b->T->vheap->newstorage = STORE_MODE(b->batMaptheap, brestrict || trestrict, existing, b->T->vheap->storage, force); - if (force) - b->T->vheap->forcemap = 1; - } -} - -void -BATmmap(BAT *b, int hb, int tb, int hhp, int thp, int force) -{ - if (b == NULL) - return; - IODEBUG fprintf(stderr, "#BATmmap(%s,%d,%d,%d,%d%s)\n", BATgetId(b), hb, tb, hhp, thp, force ? ",force" : ""); - - /* Reverse back if required, as this determines which heap is - * saved in the "hheap" file and which in the "theap" file. - */ - if (b->batCacheid < 0) { - int swap = hb; - hb = tb; - tb = swap; - swap = hhp; - hhp = thp; - thp = swap; - b = BATmirror(b); - } - b->batMaphead = hb; - b->batMaptail = tb; - b->batMaphheap = hhp; - b->batMaptheap = thp; - HEAPnewstorage(b, force); - b->batDirtydesc = 1; -} - -/* * @- Change the BAT access permissions (read, append, write) * Regrettably, BAT access-permissions, persistent status and memory * map modes, interact in ways that makes one's brain sizzle. This @@ -1797,13 +1726,8 @@ BATmmap(BAT *b, int hb, int tb, int hhp, * Note that this code is not about making heaps mmap-ed in the first * place. It is just about determining which flavor of mmap should be * used. The MAL user is oblivious of such details. - * - * The route for making heaps mmapped in the first place (or make them - * no longer so) is to request a mode change with BATmmap. The - * requested modes are remembered in b->batMap*. At the next re-load - * of the BAT, they are applied after a sanity check (DESCsetmodes() - * in gdk_storage.mx). @end verbatim */ + /* rather than deleting X.new, we comply with the commit protocol and * move it to backup storage */ static gdk_return _______________________________________________ checkin-list mailing list [email protected] https://www.monetdb.org/mailman/listinfo/checkin-list
