Changeset: f1939120bdc0 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=f1939120bdc0 Modified Files: Branch: default Log Message:
Merge with Oct2010 branch. diffs (truncated from 1144 to 300 lines): diff -r a640372204d4 -r f1939120bdc0 MonetDB/src/gdk/gdk.mx --- a/MonetDB/src/gdk/gdk.mx Thu Sep 23 12:37:30 2010 +0200 +++ b/MonetDB/src/gdk/gdk.mx Thu Sep 23 12:55:59 2010 +0200 @@ -450,6 +450,7 @@ #define PATHLENGTH 1024 /* maximum file pathname length */ #endif +/* @ @} @@ -473,6 +474,7 @@ The interface definitions for the application programs are shown below. The global variables should not be modified directly. @h +*/ #define NEG(A) (((int)(A))>0?-((int)(A)):((int)(A))) #define ABS(A) (((int)(A))>0?((int)(A)):-((int)(A))) @@ -633,8 +635,10 @@ #endif #define BUN_MAX (BUN_NONE - 1) /* maximum allowed size of a BAT */ +/* @- Checking and Error definitions: @h +*/ typedef enum { GDK_FAIL, GDK_SUCCEED } gdk_return; gdk_export int GDKsilent; /* should GDK shut up? */ @@ -687,7 +691,7 @@ ATOMname(BATttype(P2)), ATOMname(BATttype(P1))); \ } \ } -...@h + typedef struct { size_t maxsize; /* maximum realloc size (bytes) */ size_t free; /* index where free area starts. */ @@ -712,6 +716,7 @@ Heap *heap; /* heap where the hash is stored */ } Hash; +/* @ @} @@ -770,6 +775,7 @@ @{ @h +*/ typedef struct { bat id; int stamp; @@ -813,6 +819,7 @@ gdk_export void *VALget(ValPtr v); gdk_export int VALcmp(ValPtr p, ValPtr q); +/* @} @- The BAT record @@ -821,45 +828,45 @@ use a @emph{BAT} type that is supposed to look like this: @verbatim typedef struct { - /* static BAT properties */ - bat batCacheid; /* bat id: index in BBPcache */ - int batPersistence; /* persistence mode */ - bit batCopiedtodisk; /* BAT is saved on disk? */ - bit batSet; /* all tuples in the BAT are unique? */ - /* dynamic BAT properties */ - int batHeat; /* heat of BAT in the BBP */ - sht batDirty; /* BAT modified after last commit? */ - bit batDirtydesc; /* BAT descriptor specific dirty flag */ - Heap* batBuns; /* Heap where the buns are stored */ - /* DELTA status */ - BUN batDeleted; /* first deleted BUN */ - BUN batFirst; /* empty BUN before the first alive BUN */ - BUN batInserted; /* first inserted BUN */ - BUN batCount; /* Tuple count */ - /* Head properties */ - int htype; /* Head type number */ - str hident; /* name for head column */ - bit hkey; /* head values should be unique? */ - bit hsorted; /* are head values currently ordered? */ - bit hvarsized; /* for speed: head type is varsized? */ - bit hnonil; /* head has no nils */ - oid halign; /* alignment OID for head. */ - /* Head storage */ - int hloc; /* byte-offset in BUN for head elements */ - Heap *hheap; /* heap for varsized head values */ - Hash *hhash; /* linear chained hash table on head */ - /* Tail properties */ - int ttype; /* Tail type number */ - str tident; /* name for tail column */ - bit tkey; /* tail values should be unique? */ - bit tnonil; /* tail has no nils */ - bit tsorted; /* are tail values currently ordered? */ - bit tvarsized; /* for speed: tail type is varsized? */ - oid talign; /* alignment OID for head. */ - /* Tail storage */ - int tloc; /* byte-offset in BUN for tail elements */ - Heap theap; /* heap for varsized tail values */ - Hash thash; /* linear chained hash table on tail */ + // static BAT properties + bat batCacheid; // bat id: index in BBPcache + int batPersistence; // persistence mode + bit batCopiedtodisk; // BAT is saved on disk? + bit batSet; // all tuples in the BAT are unique? + // dynamic BAT properties + int batHeat; // heat of BAT in the BBP + sht batDirty; // BAT modified after last commit? + bit batDirtydesc; // BAT descriptor specific dirty flag + Heap* batBuns; // Heap where the buns are stored + // DELTA status + BUN batDeleted; // first deleted BUN + BUN batFirst; // empty BUN before the first alive BUN + BUN batInserted; // first inserted BUN + BUN batCount; // Tuple count + // Head properties + int htype; // Head type number + str hident; // name for head column + bit hkey; // head values should be unique? + bit hsorted; // are head values currently ordered? + bit hvarsized; // for speed: head type is varsized? + bit hnonil; // head has no nils + oid halign; // alignment OID for head. + // Head storage + int hloc; // byte-offset in BUN for head elements + Heap *hheap; // heap for varsized head values + Hash *hhash; // linear chained hash table on head + // Tail properties + int ttype; // Tail type number + str tident; // name for tail column + bit tkey; // tail values should be unique? + bit tnonil; // tail has no nils + bit tsorted; // are tail values currently ordered? + bit tvarsized; // for speed: tail type is varsized? + oid talign; // alignment OID for head. + // Tail storage + int tloc; // byte-offset in BUN for tail elements + Heap theap; // heap for varsized tail values + Hash thash; // linear chained hash table on tail } BAT; @end verbatim @@ -883,6 +890,7 @@ @{ @h +*/ typedef struct { MT_Id tid; /* which thread created it */ @@ -972,10 +980,12 @@ oid hvid, tvid; } BATiter; +/* @- The different parts of which a BAT consists are physically stored next to each other in the @%BATstore@ type. @h +*/ typedef struct { BAT B; /* storage for BAT descriptor */ BAT BM; /* mirror (reverse) BAT */ @@ -1026,6 +1036,7 @@ #define batMaptail P->map_tail #define batMaphheap P->map_hheap #define batMaptheap P->map_theap +/* @ @} @@ -1064,6 +1075,7 @@ they isolate you from the different ways heaps can be accessed. @{ @h +*/ gdk_export int HEAPalloc(Heap *h, size_t nitems, size_t itemsize); gdk_export int HEAPfree(Heap *h); gdk_export int HEAPextend(Heap *h, size_t size); @@ -1077,6 +1089,7 @@ gdk_export size_t HEAPvmsize(Heap *h); gdk_export size_t HEAPmemsize(Heap *h); +/* @} @- Internal HEAP Chunk Management Heaps are used in BATs to store data for variable-size atoms. @@ -1108,6 +1121,7 @@ @%HEAP_private@ returns an integer index to private space. @{ @h +*/ /* structure used by HEAP_check functions */ typedef struct { size_t minpos; /* minimum block byte-index */ @@ -1144,6 +1158,7 @@ #define HEAP_index(HEAP,INDEX,TYPE) ((TYPE *)((char *) (HEAP)->base + (INDEX))) +/* @} @- BAT construction @multitable @columnfractions 0.08 0.7 @@ -1165,6 +1180,7 @@ inherited from its argument. @{ @h +*/ #define BATDELETE (-9999) gdk_export BAT *BATnew(int hdtype, int tltype, BUN capacity); @@ -1178,6 +1194,7 @@ gdk_export chr ATOMelmshift(int sz); gdk_export void BATsetdims(BAT *b); +/* @ @} @@ -1272,6 +1289,7 @@ @end itemize @{ @h +*/ /* NOTE: `p' is evaluated after a possible upgrade of the heap */ #define Hputvalue(b, p, v, copyall) \ do { \ @@ -1613,6 +1631,7 @@ #define BATcount(b) ((b)->batCount) #endif +/* @ @} @@ -1683,6 +1702,7 @@ was in there. @{ @h +*/ gdk_export str BATrename(BAT *b, str nme); #ifndef BATcount gdk_export BUN BATcount(BAT *b); @@ -1720,6 +1740,7 @@ #define BAT_APPEND 2 /* only reads and appends allowed */ #define BATcapacity(b) (b)->batCapacity +/* @ @} @@ -1758,6 +1779,7 @@ exist at the same time. @{ @h +*/ gdk_export BAT *BATclear(BAT *b); gdk_export BAT *BATcopy(BAT *b, int ht, int tt, int writeable); gdk_export BAT *BATmark(BAT *b, oid base); @@ -1765,6 +1787,7 @@ gdk_export BAT *BATnumber(BAT *b); gdk_export BAT *BATgroup(BAT *b, int start, int incr, int grpsize); +/* @ @} @@ -1805,6 +1828,7 @@ expected usage pattern of the memory in a heap. @{ @h +*/ /* Heap storage modes */ #define STORE_MEM 0 /* load into GDKmalloced memory */ #define STORE_MMAP 1 /* mmap() into virtual memory */ @@ -1854,6 +1878,7 @@ gdk_export int GDKsave(str nme, str ext, void *buf, size_t size, int mode); gdk_export int GDKunlink(str dir, str nme, str extension); gdk_export int GDKmove(str dir1, str nme1, str ext1, str dir2, str nme2, str ext2); +/* @ @} @@ -1878,10 +1903,12 @@ @{ @h +*/ gdk_export int BATprint(BAT *b); gdk_export int BATprintf(stream *f, BAT *b); gdk_export int BATmultiprintf(stream *f, int argc, BAT *argv[], int printoid, int order, int printorderby); +/* @ _______________________________________________ Checkin-list mailing list Checkin-list@monetdb.org http://mail.monetdb.org/mailman/listinfo/checkin-list