Changeset: 44e84b0416ab for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=44e84b0416ab Modified Files: clients/Tests/MAL-signatures.stable.out clients/Tests/MAL-signatures.stable.out.int128 clients/Tests/exports.stable.out gdk/ChangeLog gdk/gdk.h gdk/gdk_atoms.c gdk/gdk_bbp.c gdk/gdk_private.h gdk/gdk_utils.c monetdb5/ChangeLog monetdb5/mal/Tests/tst200.malC monetdb5/mal/Tests/tst201.malC monetdb5/mal/Tests/tst272.malC monetdb5/mal/Tests/tst275.malC monetdb5/modules/mal/01_calc.mal monetdb5/modules/mal/01_calc.mal.sh monetdb5/modules/mal/calc.c Branch: default Log Message:
Cleanup: remove GDKoid variable and supporting functions. diffs (truncated from 476 to 300 lines): diff --git a/clients/Tests/MAL-signatures.stable.out b/clients/Tests/MAL-signatures.stable.out --- a/clients/Tests/MAL-signatures.stable.out +++ b/clients/Tests/MAL-signatures.stable.out @@ -7261,9 +7261,6 @@ Ready. [ "calc", "second_interval", "command calc.second_interval(v:daytime,ek:int,sk:int):lng ", "second_interval_daytime;", "cast daytime to a second_interval and check for overflow" ] [ "calc", "second_interval", "command calc.second_interval(v:str,ek:int,sk:int):lng ", "second_interval_str;", "cast str to a second_interval and check for overflow" ] [ "calc", "second_interval", "command calc.second_interval(sc:int,v:sht,ek:int,sk:int):lng ", "sht_dec2second_interval;", "cast sht decimal to a second_interval" ] -[ "calc", "setoid", "pattern calc.setoid(v:int):void ", "CMDsetoid;", "" ] -[ "calc", "setoid", "pattern calc.setoid(v:lng):void ", "CMDsetoid;", "" ] -[ "calc", "setoid", "pattern calc.setoid(v:oid):void ", "CMDsetoid;", "" ] [ "calc", "sht", "pattern calc.sht(v:bit):sht ", "CMDvarCONVERT;", "Cast VALUE to sht" ] [ "calc", "sht", "pattern calc.sht(v:bte):sht ", "CMDvarCONVERT;", "Cast VALUE to sht" ] [ "calc", "sht", "pattern calc.sht(v:dbl):sht ", "CMDvarCONVERT;", "Cast VALUE to sht" ] diff --git a/clients/Tests/MAL-signatures.stable.out.int128 b/clients/Tests/MAL-signatures.stable.out.int128 --- a/clients/Tests/MAL-signatures.stable.out.int128 +++ b/clients/Tests/MAL-signatures.stable.out.int128 @@ -9587,9 +9587,6 @@ Ready. [ "calc", "second_interval", "command calc.second_interval(v:daytime,ek:int,sk:int):lng ", "second_interval_daytime;", "cast daytime to a second_interval and check for overflow" ] [ "calc", "second_interval", "command calc.second_interval(v:str,ek:int,sk:int):lng ", "second_interval_str;", "cast str to a second_interval and check for overflow" ] [ "calc", "second_interval", "command calc.second_interval(sc:int,v:sht,ek:int,sk:int):lng ", "sht_dec2second_interval;", "cast sht decimal to a second_interval" ] -[ "calc", "setoid", "pattern calc.setoid(v:int):void ", "CMDsetoid;", "" ] -[ "calc", "setoid", "pattern calc.setoid(v:lng):void ", "CMDsetoid;", "" ] -[ "calc", "setoid", "pattern calc.setoid(v:oid):void ", "CMDsetoid;", "" ] [ "calc", "sht", "pattern calc.sht(v:bit):sht ", "CMDvarCONVERT;", "Cast VALUE to sht" ] [ "calc", "sht", "pattern calc.sht(v:bte):sht ", "CMDvarCONVERT;", "Cast VALUE to sht" ] [ "calc", "sht", "pattern calc.sht(v:dbl):sht ", "CMDvarCONVERT;", "Cast VALUE to sht" ] 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 @@ -304,9 +304,7 @@ int MT_munmap(void *p, size_t len); int MT_path_absolute(const char *path); void MT_sleep_ms(unsigned int ms); void OIDXdestroy(BAT *b); -oid OIDbase(oid base); int OIDfromStr(const char *src, int *len, oid **dst); -oid OIDnew(oid inc); int OIDtoStr(str *dst, int *len, const oid *src); BUN ORDERfnd(BAT *b, const void *v); BUN ORDERfndfirst(BAT *b, const void *v); @@ -1080,7 +1078,6 @@ str CMDscience_cst_bat_pow_dbl(bat *ret, str CMDscience_cst_bat_pow_flt(bat *ret, const flt *d, const bat *bid); str CMDsetHeartbeat(void *res, int *ev); str CMDsetName(str *rname, const bat *b, str *name); -str CMDsetoid(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci); str CMDsetprofilerlimit(void *res, int *lim); str CMDstartProfiler(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci); str CMDstartTrace(void *res); diff --git a/gdk/ChangeLog b/gdk/ChangeLog --- a/gdk/ChangeLog +++ b/gdk/ChangeLog @@ -2,6 +2,7 @@ # This file is updated with Maddlog * Tue Dec 13 2016 Sjoerd Mullender <[email protected]> +- Removed functions OIDbase() and OIDnew(). - Removed talign field from BAT descriptor. * Mon Dec 5 2016 Sjoerd Mullender <[email protected]> diff --git a/gdk/gdk.h b/gdk/gdk.h --- a/gdk/gdk.h +++ b/gdk/gdk.h @@ -1915,29 +1915,6 @@ gdk_export int ATOMformat(int id, const gdk_export ptr ATOMdup(int id, const void *val); /* - * @- Unique OIDs - * @multitable @columnfractions 0.08 0.7 - * @item oid - * @tab - * OIDseed (oid seed); - * @item oid - * @tab - * OIDnew (oid inc); - * @end multitable - * - * OIDs are special kinds of unsigned integers because the system - * guarantees uniqueness. For system simplicity and performance, OIDs - * are now represented as (signed) integers; however this is hidden in - * the system internals and shouldn't affect semantics. - * - * The OIDnew(N) claims a range of N contiguous unique, unused OIDs, - * and returns the starting value of this range. The highest OIDBITS - * designate site. [ DEPRECATED] - */ -gdk_export oid OIDbase(oid base); -gdk_export oid OIDnew(oid inc); - -/* * @- Built-in Accelerator Functions * * @multitable @columnfractions 0.08 0.7 diff --git a/gdk/gdk_atoms.c b/gdk/gdk_atoms.c --- a/gdk/gdk_atoms.c +++ b/gdk/gdk_atoms.c @@ -1759,130 +1759,6 @@ strWrite(const char *a, stream *s, size_ } /* - * @+ Unique OIDs - * The basic type OID represents unique values. Refinements should be - * considered to link oids in time order. - * - * Values start from the "seqbase" (usually 0@0). A nil seqbase makes - * the entire column nil. Monet's BUN access methods - * BUNhead(b,p)/BUNtail(b,p) instantiate a value on-the-fly by looking - * at the position p in BAT b. - */ -static volatile ATOMIC_TYPE GDKoid; -#ifdef ATOMIC_LOCK -static MT_Lock GDKoidLock MT_LOCK_INITIALIZER("GDKoidLock"); -#endif -static oid GDKflushed; /* protected by MT_system_lock */ - -/* - * Make up some new OID for a specified database, based on the current - * time. - */ -static oid -OIDrand(void) -{ - return 1000000; -} - -/* - * Init the shared array of oid bases. - */ -int -OIDinit(void) -{ -#ifdef NEED_MT_LOCK_INIT - ATOMIC_INIT(GDKoidLock); -#endif - GDKflushed = 0; - GDKoid = OIDrand(); - assert(oid_nil == * (const oid *) ATOMnilptr(TYPE_oid)); - return 0; -} - -/* - * Initialize the current OID number to be starting at 'o'. - */ -oid -OIDbase(oid o) -{ - ATOMIC_SET(GDKoid, (ATOMIC_TYPE) o, GDKoidLock); - return o; -} - -static oid -OIDseed(oid o) -{ - oid t, p = (oid) ATOMIC_GET(GDKoid, GDKoidLock); - - t = OIDrand(); - if (o > t) - t = o; - if (p >= t) - t = p; - return t; -} - -/* - * Initialize a sequence of OID seeds (for a sequence of database) as - * stored in a string. - */ -oid -OIDread(str s) -{ - oid new = 0, *p = &new; - int l = sizeof(oid); - - while (GDKisspace(*s)) - s++; - while (GDKisdigit(*s)) { - s += OIDfromStr(s, &l, &p); - while (GDKisspace(*s)) - s++; - new = OIDseed(new); - } - return new; -} - -/* - * Write the current sequence of OID seeds to a file in string format. - */ -int -OIDwrite(FILE *f) -{ - int ret = 0; - ATOMIC_TYPE o; - - MT_lock_set(&MT_system_lock); - o = ATOMIC_GET(GDKoid, GDKoidLock); - if (o) { - GDKflushed = (oid) o; - if (fprintf(f, OIDFMT "@0", GDKflushed) < 0 || ferror(f)) - ret = -1; - } - MT_lock_unset(&MT_system_lock); - return ret; -} - -int -OIDdirty(void) -{ - int ret; - MT_lock_set(&MT_system_lock); - ret = (oid) ATOMIC_GET(GDKoid, GDKoidLock) > GDKflushed; - MT_lock_unset(&MT_system_lock); - return ret; -} - -/* - * Reserve a range of unique OIDs - */ -oid -OIDnew(oid inc) -{ - return (oid) ATOMIC_ADD(GDKoid, (ATOMIC_TYPE) inc, GDKoidLock); -} - -/* * String conversion routines. */ int diff --git a/gdk/gdk_bbp.c b/gdk/gdk_bbp.c --- a/gdk/gdk_bbp.c +++ b/gdk/gdk_bbp.c @@ -1196,7 +1196,7 @@ BBPreadEntries(FILE *fp, int oidsize, in #endif static int -BBPheader(FILE *fp, oid *BBPoid, int *OIDsize) +BBPheader(FILE *fp, int *OIDsize) { char buf[BUFSIZ]; int sz, bbpversion, ptrsize, oidsize, intsize; @@ -1246,7 +1246,6 @@ BBPheader(FILE *fp, oid *BBPoid, int *OI if (fgets(buf, sizeof(buf), fp) == NULL) { GDKfatal("BBPinit: short BBP"); } - *BBPoid = OIDread(buf); if ((s = strstr(buf, "BBPsize")) != NULL) { sscanf(s, "BBPsize=%d", &sz); sz = (int) (sz * BATMARGIN); @@ -1309,7 +1308,6 @@ BBPinit(void) struct stat st; int bbpversion; int oidsize; - oid BBPoid; str bbpdirstr = GDKfilepath(0, BATDIR, "BBP", "dir"); str backupbbpdirstr = GDKfilepath(0, BAKDIR, "BBP", "dir"); int needcommit; @@ -1358,8 +1356,9 @@ BBPinit(void) BBPlimit = 0; memset(BBP, 0, sizeof(BBP)); ATOMIC_SET(BBPsize, 1, BBPsizeLock); - - bbpversion = BBPheader(fp, &BBPoid, &oidsize); + BBPdirty(1); + + bbpversion = BBPheader(fp, &oidsize); BBPextend(0, FALSE); /* allocate BBP records */ ATOMIC_SET(BBPsize, 1, BBPsizeLock); @@ -1369,8 +1368,6 @@ BBPinit(void) BBPinithash(0); - OIDbase(BBPoid); - /* will call BBPrecover if needed */ if (BBPprepare(FALSE) != GDK_SUCCEED) GDKfatal("BBPinit: cannot properly prepare process %s. Please check whether your disk is full or write-protected", BAKDIR); @@ -1568,14 +1565,12 @@ new_bbpentry(FILE *fp, bat i) static gdk_return BBPdir_header(FILE *f, int n) { - if (fprintf(f, "BBP.dir, GDKversion %d\n%d %d %d\n", + if (fprintf(f, "BBP.dir, GDKversion %d\n%d %d %d\n0@0 BBPsize=%d\n", GDKLIBRARY, SIZEOF_SIZE_T, SIZEOF_OID, #ifdef HAVE_HGE havehge ? SIZEOF_HGE : #endif - SIZEOF_LNG) < 0 || - OIDwrite(f) < 0 || - fprintf(f, " BBPsize=%d\n", n) < 0 || + SIZEOF_LNG, n) < 0 || ferror(f)) { GDKsyserror("BBPdir_header: Writing BBP.dir header failed\n"); return GDK_FAIL; @@ -1622,11 +1617,6 @@ BBPdir_subcommit(int cnt, bat *subcommit if (GDKdebug & (IOMASK | THRDMASK)) fprintf(stderr, "#BBPdir: writing BBP.dir (%d bats).\n", n); - IODEBUG { - fprintf(stderr, "#BBPdir start oid="); - OIDwrite(stderr); - fprintf(stderr, "\n"); - } _______________________________________________ checkin-list mailing list [email protected] https://www.monetdb.org/mailman/listinfo/checkin-list
