Changeset: a491a924e3da for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=a491a924e3da
Modified Files:
gdk/gdk.h
monetdb5/modules/mal/mat.c
Branch: default
Log Message:
Get rid of BATrec struct: incorporate into BAT struct.
diffs (99 lines):
diff --git a/gdk/gdk.h b/gdk/gdk.h
--- a/gdk/gdk.h
+++ b/gdk/gdk.h
@@ -732,25 +732,6 @@ gdk_export int VALisnil(const ValRecord
* @c image{http://monetdb.cwi.nl/projects/monetdb-mk/imgs/bat2,,,,feps}
*/
-typedef struct {
- /* dynamic bat properties */
- MT_Id tid; /* which thread created it */
- uint32_t
- copiedtodisk:1, /* once written */
- dirtyflushed:1, /* was dirty before commit started? */
- descdirty:1, /* bat descriptor dirty marker */
- restricted:2, /* access privileges */
- persistence:1, /* should the BAT persist on disk? */
- role:8, /* role of the bat */
- unused:18; /* value=0 for now (sneakily used by mat.c) */
- int sharecnt; /* incoming view count */
-
- /* delta status administration */
- BUN inserted; /* start of inserted elements */
- BUN count; /* tuple count */
- BUN capacity; /* tuple capacity */
-} BATrec;
-
typedef struct PROPrec PROPrec;
/* see also comment near BATassertProps() for more information about
@@ -799,10 +780,25 @@ typedef struct BAT {
bat batCacheid; /* index into BBP */
oid hseqbase; /* head seq base */
+ /* dynamic bat properties */
+ MT_Id creator_tid; /* which thread created it */
+ uint32_t
+ batCopiedtodisk:1, /* once written */
+ batDirtyflushed:1, /* was dirty before commit started? */
+ batDirtydesc:1, /* bat descriptor dirty marker */
+ batRestricted:2, /* access privileges */
+ batPersistence:1, /* should the BAT persist on disk? */
+ batRole:8, /* role of the bat */
+ unused:18; /* value=0 for now (sneakily used by mat.c) */
+ int batSharecnt; /* incoming view count */
+
+ /* delta status administration */
+ BUN batInserted; /* start of inserted elements */
+ BUN batCount; /* tuple count */
+ BUN batCapacity; /* tuple capacity */
+
/* dynamic column properties */
COLrec T; /* column info */
-
- BATrec S; /* the BAT properties */
} BAT;
typedef struct BATiter {
@@ -811,18 +807,6 @@ typedef struct BATiter {
} BATiter;
/* macros to hide complexity of the BAT structure */
-#define batPersistence S.persistence
-#define batCopiedtodisk S.copiedtodisk
-#define batConvert S.convert
-#define batDirtyflushed S.dirtyflushed
-#define batDirtydesc S.descdirty
-#define batInserted S.inserted
-#define batCount S.count
-#define batCapacity S.capacity
-#define batSharecnt S.sharecnt
-#define batRestricted S.restricted
-#define batRole S.role
-#define creator_tid S.tid
#define ttype T.type
#define tkey T.key
#define tunique T.unique
diff --git a/monetdb5/modules/mal/mat.c b/monetdb5/modules/mal/mat.c
--- a/monetdb5/modules/mal/mat.c
+++ b/monetdb5/modules/mal/mat.c
@@ -132,7 +132,7 @@ MATpackIncrement(Client cntxt, MalBlkPtr
throw(MAL, "mat.pack", GDK_EXCEPTION);
}
assert(!bn->tnil || !bn->tnonil);
- bn->S.unused = (pieces-1); /* misuse "unused" field */
+ bn->unused = (pieces-1); /* misuse "unused" field */
BBPkeepref(*ret = bn->batCacheid);
BBPunfix(b->batCacheid);
} else {
@@ -150,8 +150,8 @@ MATpackIncrement(Client cntxt, MalBlkPtr
}
BBPunfix(bb->batCacheid);
}
- b->S.unused--;
- if(b->S.unused == 0)
+ b->unused--;
+ if(b->unused == 0)
BATsetaccess(b, BAT_READ);
assert(!b->tnil || !b->tnonil);
BBPkeepref(*ret = b->batCacheid);
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list