LCOV - code coverage report
Current view: top level - gdk - gdk_delta.h (source / functions) Hit Total Coverage
Test: coverage.info Lines: 7 7 100.0 %
Date: 2021-09-14 19:48:19 Functions: 1 1 100.0 %

          Line data    Source code
       1             : /*
       2             :  * This Source Code Form is subject to the terms of the Mozilla Public
       3             :  * License, v. 2.0.  If a copy of the MPL was not distributed with this
       4             :  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
       5             :  *
       6             :  * Copyright 1997 - July 2008 CWI, August 2008 - 2021 MonetDB B.V.
       7             :  */
       8             : 
       9             : #ifndef _GDK_DELTA_H_
      10             : #define _GDK_DELTA_H_
      11             : 
      12             : /*
      13             :  * We make sure here that the BUNs section of a BAT at least starts 4
      14             :  * bytes from the BUN start.  This ensures that the first data item of
      15             :  * e.g. a BAT[void,bit] is (at least) integer aligned.  This optimizes
      16             :  * processing on such BATs (DDBENCH).
      17             :  */
      18             : static inline void
      19    10984440 : DELTAinit(BAT *b)
      20             : {
      21    10984440 :         BATsetcount(b, 0);
      22    11049177 :         b->theap->free = 0;
      23    11049177 :         b->batInserted = 0;
      24    11049177 :         b->tshift = ATOMelmshift(Tsize(b));
      25    11049177 :         TRC_DEBUG(DELTA,
      26             :                   "%s free %zu ins " BUNFMT " base %p\n",
      27             :                   BBP_logical(b->batCacheid),
      28             :                   b->theap->free,
      29             :                   b->batInserted,
      30             :                   b->theap->base);
      31    11049177 : }
      32             : 
      33             : /*
      34             :  * Upon saving a BAT, we should convert the delta marker BUN pointers
      35             :  * into indexes and convert them back into pointers upon reload.
      36             :  *
      37             :  * The BATdirty(b) tells you whether a BAT's main memory
      38             :  * representation differs from its saved image on stable storage. But
      39             :  * *not* whether it has changed since last transaction commit (it can
      40             :  * be storage-clean, but transaction-dirty). For this we have
      41             :  * DELTAdirty(b).
      42             :  */
      43             : #define DELTAdirty(b)   ((b)->batInserted < BUNlast(b))
      44             : 
      45             : #endif /* _GDK_DELTA_H_ */

Generated by: LCOV version 1.14