Re: [Monetdb-developers] MonetDB: default - Add HEADLESS warning flag
FYI: "headless" means *dense* BAT heads (unless they are void-nil). S. ----- Original Message -----
Changeset: 3be4152afaa3 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=3be4152afaa3 Modified Files: gdk/gdk.h gdk/gdk_bat.c gdk/gdk_bat.h monetdb5/mal/mal_dataflow.c monetdb5/mal/mal_interpreter.c Branch: default Log Message:
Add HEADLESS warning flag During conversion towards :oid and col it would be nice to trap all cases where an 'alien' bat is created. A free bit in the debug flag is used for that purpose.
diffs (71 lines):
diff --git a/gdk/gdk.h b/gdk/gdk.h --- a/gdk/gdk.h +++ b/gdk/gdk.h @@ -2334,6 +2334,8 @@ VALptr(const ValRecord *v) */ #define PARMASK (1<<7) #define PARDEBUG if (GDKdebug & PARMASK) +#define HEADLESSMASK (1<<8) +#define HEADLESSDEBUG if ( GDKdebug & HEADLESSMASK) /* TRGMASK not used anymore #define TRGMASK (1<<8) #define TRGDEBUG if (GDKdebug & TRGMASK) diff --git a/gdk/gdk_bat.c b/gdk/gdk_bat.c --- a/gdk/gdk_bat.c +++ b/gdk/gdk_bat.c @@ -89,6 +89,11 @@ BATcreatedesc(int ht, int tt, int heapna
if (bs == NULL) return NULL; + HEADLESSDEBUG { + if ( ht != TYPE_void && ht != TYPE_oid) + fprintf(stderr, "#headless violation in BATcreatedesc %d\n", ht); + + } /* * assert needed in the kernel to get symbol eprintf resolved. * Else modules using assert fail to load. @@ -2799,7 +2804,7 @@ BATmode(BAT *b, int mode) * is not actually used anywhere, but it is checked. */
#ifndef NDEBUG -void +static void BATassertHeadProps(BAT *b) { BATiter bi = bat_iterator(b); diff --git a/gdk/gdk_bat.h b/gdk/gdk_bat.h --- a/gdk/gdk_bat.h +++ b/gdk/gdk_bat.h @@ -23,7 +23,6 @@ gdk_export BUN void_replace_bat(BAT *b, BAT *u, bit force); gdk_export int void_inplace(BAT *b, oid id, const void *val, bit force); gdk_export BAT *BATattach(int tt, const char *heapfile); -gdk_export void BATassertHeadProps(BAT *b);
extern int default_ident(char *s); extern oid MAXoid(BAT *i); diff --git a/monetdb5/mal/mal_dataflow.c b/monetdb5/mal/mal_dataflow.c --- a/monetdb5/mal/mal_dataflow.c +++ b/monetdb5/mal/mal_dataflow.c @@ -618,7 +618,7 @@ DFLOWstep(FlowTask *t, FlowStatus fs) #if 0 /* when needed, enable */ if (i < pci->retc && bid){ BAT *b = BATdescriptor(bid); - BATassertHeadProps(b); + BATassertProps(b); BBPunfix(b->batCacheid); } #endif diff --git a/monetdb5/mal/mal_interpreter.c b/monetdb5/mal/mal_interpreter.c --- a/monetdb5/mal/mal_interpreter.c +++ b/monetdb5/mal/mal_interpreter.c @@ -860,7 +860,7 @@ str runMALsequence(Client cntxt, MalBlkP #if 0 /* when needed, enable */ if (i < pci->retc && bid){ BAT *b = BATdescriptor(bid); - BATassertHeadProps(b); + BATassertProps(b); BBPunfix(b->batCacheid); } #endif _______________________________________________ Checkin-list mailing list Checkin-list@monetdb.org http://mail.monetdb.org/mailman/listinfo/checkin-list
participants (1)
-
Stefan Manegold