From: Marc Munro Date: Fri, 27 Jun 2014 23:56:23 +0000 (-0700) Subject: 8-byte stuff added, X-Git-Url: http://git.postgresql.org/gitweb/edit?a=commitdiff_plain;h=1fd92c4b6bd70b5f31797ea3aa0eb9660b804104;p=veil.git 8-byte stuff added, --- diff --git a/GNUmakefile b/GNUmakefile index 1ecccd8..4a15e78 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -41,7 +41,11 @@ PG_CONFIG = pg_config PGXS := $(shell $(PG_CONFIG) --pgxs) include $(PGXS) -override CFLAGS := $(CFLAGS) -O0 +ifneq ($(origin FORCE_32_BIT), undefined) +DFORCE_32_BIT = -DFORCE_32_BIT=1 +endif + +override CFLAGS := $(CFLAGS) -O0 $(DFORCE_32_BIT) include $(DEPS) diff --git a/src/veil_bitmap.c b/src/veil_bitmap.c index 7ad4c04..c77dac4 100644 --- a/src/veil_bitmap.c +++ b/src/veil_bitmap.c @@ -17,7 +17,38 @@ #include "veil_funcs.h" - +#ifdef USE_64_BIT +/** + * Array of bit positions for int64, indexed by bitno. + */ +static +uint64 bitmasks[64] = { + 0x00000001, 0x00000002, 0x00000004, 0x00000008, + 0x00000010, 0x00000020, 0x00000040, 0x00000080, + 0x00000100, 0x00000200, 0x00000400, 0x00000800, + 0x00001000, 0x00002000, 0x00004000, 0x00008000, + 0x00010000, 0x00020000, 0x00040000, 0x00080000, + 0x00100000, 0x00200000, 0x00400000, 0x00800000, + 0x01000000, 0x02000000, 0x04000000, 0x08000000, + 0x10000000, 0x20000000, 0x40000000, 0x80000000, + 0x0000000100000000, 0x0000000200000000, + 0x0000000400000000, 0x0000000800000000, + 0x0000001000000000, 0x0000002000000000, + 0x0000004000000000, 0x0000008000000000, + 0x0000010000000000, 0x0000020000000000, + 0x0000040000000000, 0x0000080000000000, + 0x0000100000000000, 0x0000200000000000, + 0x0000400000000000, 0x0000800000000000, + 0x0001000000000000, 0x0002000000000000, + 0x0004000000000000, 0x0008000000000000, + 0x0010000000000000, 0x0020000000000000, + 0x0040000000000000, 0x0080000000000000, + 0x0100000000000000, 0x0200000000000000, + 0x0400000000000000, 0x0800000000000000, + 0x1000000000000000, 0x2000000000000000, + 0x4000000000000000, 0x8000000000000000}; + +#else /** * Array of bit positions for int32, indexed by bitno. */ @@ -31,6 +62,7 @@ uint32 bitmasks[] = {0x00000001, 0x00000002, 0x00000004, 0x00000008, 0x01000000, 0x02000000, 0x04000000, 0x08000000, 0x10000000, 0x20000000, 0x40000000, 0x80000000}; +#endif /** * Clear all bits in a ::Bitmap. @@ -88,10 +120,10 @@ vl_NewBitmap(Bitmap **p_bitmap, bool shared, if (!bitmap) { /* We need a new bitmap */ if (shared) { - bitmap = vl_shmalloc(sizeof(Bitmap) + (sizeof(int32) * elems)); + bitmap = vl_shmalloc(sizeof(Bitmap) + (sizeof(bm_int) * elems)); } else { - bitmap = vl_malloc(sizeof(Bitmap) + (sizeof(int32) * elems)); + bitmap = vl_malloc(sizeof(Bitmap) + (sizeof(bm_int) * elems)); } } @@ -602,3 +634,5 @@ vl_BitmapHashHasKey(BitmapHash *bmhash, (void) hash_search(bmhash->hash, hashelem, HASH_FIND, &found); return found; } + + diff --git a/src/veil_config.d b/src/veil_config.d index ce47906..e69de29 100644 --- a/src/veil_config.d +++ b/src/veil_config.d @@ -1,5 +0,0 @@ -src/veil_config.o src/veil_config.d: \ - src/veil_config.c \ - src/veil_version.h \ - src/veil_funcs.h \ - src/veil_datatypes.h diff --git a/src/veil_datatypes.d b/src/veil_datatypes.d index 2090d11..e69de29 100644 --- a/src/veil_datatypes.d +++ b/src/veil_datatypes.d @@ -1,4 +0,0 @@ -src/veil_datatypes.o src/veil_datatypes.d: \ - src/veil_datatypes.c \ - src/veil_datatypes.h \ - src/veil_funcs.h diff --git a/src/veil_datatypes.h b/src/veil_datatypes.h index 40e2f02..929d7af 100644 --- a/src/veil_datatypes.h +++ b/src/veil_datatypes.h @@ -189,29 +189,45 @@ typedef struct Int4Var { /** * Subtype of Object for storing range values. A range has an upper and - * lower bound, both stored as int8s. Nulls are not allowed. + * lower bound, both stored as int4s. Nulls are not allowed. */ typedef struct Range { ObjType type; /**< This must have the value OBJ_RANGE */ - int64 min; /**< Lower limit for range. */ - int64 max; /**< Upper limit for range. */ + int32 min; /**< Lower limit for range. */ + int32 max; /**< Upper limit for range. */ } Range; +/* Bitmaps will be based on 64-bit integers if pointer types are 64-bit, + * unless FORCE_32_BIT is defined. + */ +#ifdef FORCE_32_BIT +#undef USE_64_BIT +#else +#if (SIZEOF_VOID_P == 8) +#define USE_64_BIT 1 +#else +#undef USE_64_BIT +#endif +#endif /** * Gives the bitmask index for the bitzero value of a Bitmap. This is * part of the "normalisation" process for bitmap ranges. This process * allows unlike bitmaps to be more easily compared by forcing bitmap - * indexes to be normalised around 32-bit word boundaries. Eg, 2 bitmaps - * with domains 1 to 50 and 3 to 55, will have identical bit patterns - * for bits 3 to 50. + * indexes to be normalised around 32 or 64 bit word boundaries. Eg, 2 + * bitmaps with domains 1 to 50 and 3 to 55, will have identical bit + * patterns for bits 3 to 50. * * @param x The bitzero value of a bitmap * * @return The bitmask index representing x. */ +#ifdef USE_64_BIT +#define BITZERO(x) (x & 0xffffffffffffffc0) +#else #define BITZERO(x) (x & 0xffffffe0) +#endif /** * Gives the bitmask index for the bitmax value of a bitmap. See @@ -221,7 +237,11 @@ typedef struct Range { * * @return The bitmask index representing x. */ +#ifdef USE_64_BIT +#define BITMAX(x) (x | 0x3f) +#else #define BITMAX(x) (x | 0x1f) +#endif /** * Gives the index of a bit within the array of 32-bit words that @@ -231,7 +251,11 @@ typedef struct Range { * * @return The array index of the bit. */ +#ifdef USE_64_BIT +#define BITSET_ELEM(x) (x >> 6) +#else #define BITSET_ELEM(x) (x >> 5) +#endif /** * Gives the index into ::bitmasks for the bit specified in x. @@ -240,7 +264,11 @@ typedef struct Range { * * @return The bitmask index */ +#ifdef USE_64_BIT +#define BITSET_BIT(x) (x & 0x3f) +#else #define BITSET_BIT(x) (x & 0x1f) +#endif /** * Gives the number of array elements in a ::Bitmap that runs from @@ -251,7 +279,11 @@ typedef struct Range { * * @return The number of elements in the bitmap. */ +#ifdef USE_64_BIT +#define ARRAYELEMS(min,max) (((max - BITZERO(min)) >> 6) + 1) +#else #define ARRAYELEMS(min,max) (((max - BITZERO(min)) >> 5) + 1) +#endif /** @@ -265,6 +297,11 @@ typedef struct Range { */ #define MIN(a,b) ((a < b)? a: b) +#ifdef USE_64_BIT +typedef uint64 bm_int; +#else +typedef uint32 bm_int; +#endif /** * Subtype of Object for storing bitmaps. A bitmap is stored as an @@ -280,7 +317,7 @@ typedef struct Bitmap { * store */ int32 bitmax; /**< The index of the highest bit the bitmap can * store */ - uint32 bitset[EMPTY]; /**< Element zero of the array of int4 values + bm_int bitset[EMPTY]; /**< Element zero of the array of int4 values * comprising the bitmap. */ } Bitmap; diff --git a/src/veil_interface.c b/src/veil_interface.c index ac50c20..6b96c08 100644 --- a/src/veil_interface.c +++ b/src/veil_interface.c @@ -685,16 +685,16 @@ veil_share(PG_FUNCTION_ARGS) PG_FUNCTION_INFO_V1(veil_init_range); /** - * veil_init_range(name text, min int8, max int8) returns int8 + * veil_init_range(name text, min int4, max int4) returns int4 * Initialise a Range variable called NAME constrained by MIN and MAX, * returning the number of elements in the range. Ranges may be * examined using the veil_range() function. * * @param fcinfo name text The name of the variable to * initialise. - *
min int8 The min value of the range. - *
max int8 The max value of the range. - * @return int8 The size of the range ((max - min) + 1). + *
min int4 The min value of the range. + *
max int4 The max value of the range. + * @return int4 The size of the range ((max - min) + 1). */ Datum veil_init_range(PG_FUNCTION_ARGS) @@ -706,14 +706,14 @@ veil_init_range(PG_FUNCTION_ARGS) ensure_init(); name = strfromtext(PG_GETARG_TEXT_P(0)); - min = PG_GETARG_INT64(1); - max = PG_GETARG_INT64(2); + min = PG_GETARG_INT32(1); + max = PG_GETARG_INT32(2); range = GetRange(name, true); range->min = min; range->max = max; - PG_RETURN_INT64(max + 1 - min); + PG_RETURN_INT32(max + 1 - min); } diff --git a/src/veil_interface.d b/src/veil_interface.d index a242884..e69de29 100644 --- a/src/veil_interface.d +++ b/src/veil_interface.d @@ -1,5 +0,0 @@ -src/veil_interface.o src/veil_interface.d: \ - src/veil_interface.c \ - src/veil_version.h \ - src/veil_funcs.h \ - src/veil_datatypes.h diff --git a/src/veil_interface.sqs b/src/veil_interface.sqs index 451d3b9..ea06d6f 100644 --- a/src/veil_interface.sqs +++ b/src/veil_interface.sqs @@ -91,11 +91,11 @@ This is intended for interactive use for debugging purposes.'; create or replace -function veil.init_range(name text, min int4, max int4) returns int4 +function veil.init_range(name text, min int, max int) returns int as '@LIBPATH@', 'veil_init_range' language C stable strict; -comment on function veil.init_range(text, int4, int4) is +comment on function veil.init_range(text, int, int) is 'Initialise a Range variable called NAME constrained by MIN and MAX. Return the number of elements in the range. @@ -140,11 +140,11 @@ Clear (set to zero) all bits in the named bitmap.'; create or replace -function veil.bitmap_setbit(bitmap_name text, bit_number int4) returns bool +function veil.bitmap_setbit(bitmap_name text, bit_number int) returns bool as '@LIBPATH@', 'veil_bitmap_setbit' language C stable strict; -comment on function veil.bitmap_setbit(text, int4) is +comment on function veil.bitmap_setbit(text, int) is 'In the Bitmap or BitmapRef identified by BITMAP_NAME, set the bit given by BIT_NUMBER. @@ -154,11 +154,11 @@ Set to 1, the identified bit.'; create or replace -function veil.bitmap_clearbit(bitmap_name text, bit_number int4) returns bool +function veil.bitmap_clearbit(bitmap_name text, bit_number int) returns bool as '@LIBPATH@', 'veil_bitmap_clearbit' language C stable strict; -comment on function veil.bitmap_clearbit(text, int4) is +comment on function veil.bitmap_clearbit(text, int) is 'In the Bitmap or BitmapRef identified by BITMAP_NAME, clear the bit given by BIT_NUMBER. @@ -168,11 +168,11 @@ Set to 0, the identified bit.'; create or replace -function veil.bitmap_testbit(bitmap_name text, bit_number int4) returns bool +function veil.bitmap_testbit(bitmap_name text, bit_number int) returns bool as '@LIBPATH@', 'veil_bitmap_testbit' language C stable strict; -comment on function veil.bitmap_testbit(text, int4) is +comment on function veil.bitmap_testbit(text, int) is 'In the Bitmap or BitmapRef identified by BITMAP_NAME, test the bit given by BIT_NUMBER. @@ -205,7 +205,7 @@ Return TRUE, or raise an error.'; create or replace -function veil.bitmap_bits(bitmap_name text) returns setof int4 +function veil.bitmap_bits(bitmap_name text) returns setof int as '@LIBPATH@', 'veil_bitmap_bits' language C stable strict; @@ -253,12 +253,12 @@ Return TRUE or raise an error'; create or replace function veil.bitmap_from_array(bmref_name text, bmarray text, - index int4) returns text + index int) returns text as '@LIBPATH@', 'veil_bitmap_from_array' language C stable strict; -comment on function veil.bitmap_from_array(text, text, int4) is +comment on function veil.bitmap_from_array(text, text, int) is 'Set BitmapRef BMREF_NAME to the bitmap from BMARRAY indexed by INDEX. Return the name of the BitmapRef. @@ -271,12 +271,12 @@ the transaction they are defined.'; create or replace function veil.bitmap_array_testbit( - bmarray text, arr_idx int4, bitno int4) returns bool + bmarray text, arr_idx int, bitno int) returns bool as '@LIBPATH@', 'veil_bitmap_array_testbit' language C stable strict; -comment on function veil.bitmap_array_testbit(text, int4, int4) is +comment on function veil.bitmap_array_testbit(text, int, int) is 'Test a bit in BMARRAY, from the bitmap indexed by ARR_IDX, checking the bit identified by BITNO. @@ -285,12 +285,12 @@ Return TRUE if the bit is set, else FALSE'; create or replace function veil.bitmap_array_setbit( - bmarray text, arr_idx int4, bitno int4) returns bool + bmarray text, arr_idx int, bitno int) returns bool as '@LIBPATH@', 'veil_bitmap_array_setbit' language C stable strict; -comment on function veil.bitmap_array_setbit(text, int4, int4) is +comment on function veil.bitmap_array_setbit(text, int, int) is 'Set a bit in BMARRAY, from the bitmap indexed by ARR_IDX, setting the bit identified by BITNO. @@ -299,12 +299,12 @@ Return TRUE'; create or replace function veil.bitmap_array_clearbit( - bmarray text, arr_idx int4, bitno int4) returns bool + bmarray text, arr_idx int, bitno int) returns bool as '@LIBPATH@', 'veil_bitmap_array_clearbit' language C stable strict; -comment on function veil.bitmap_array_clearbit(text, int4, int4) is +comment on function veil.bitmap_array_clearbit(text, int, int) is 'Clear a bit in BMARRAY, from the bitmap indexed by ARR_IDX, clearing the bit identified by BITNO. @@ -313,12 +313,12 @@ Return TRUE'; create or replace function veil.union_from_bitmap_array( - bitmap text, bmarray text, arr_idx int4) returns bool + bitmap text, bmarray text, arr_idx int) returns bool as '@LIBPATH@', 'veil_union_from_bitmap_array' language C stable strict; -comment on function veil.union_from_bitmap_array(text, text, int4) is +comment on function veil.union_from_bitmap_array(text, text, int) is 'Union BITMAP with BMARRAY[ARR_IDX], with the result going into bitmap. Return TRUE'; @@ -326,24 +326,24 @@ Return TRUE'; create or replace function veil.intersect_from_bitmap_array( - bitmap text, bmarray text, arr_idx int4) returns bool + bitmap text, bmarray text, arr_idx int) returns bool as '@LIBPATH@', 'veil_intersect_from_bitmap_array' language C stable strict; -comment on function veil.intersect_from_bitmap_array(text, text, int4) is +comment on function veil.intersect_from_bitmap_array(text, text, int) is 'Intersect BITMAP with BMARRAY[ARR_IDX], with the result going into bitmap. Return TRUE'; create or replace -function veil.bitmap_array_bits(bmarray text, arr_idx int4) returns setof int4 +function veil.bitmap_array_bits(bmarray text, arr_idx int) returns setof int4 as '@LIBPATH@', 'veil_bitmap_array_bits' language C stable strict; -comment on function veil.bitmap_array_bits(text, int4) is +comment on function veil.bitmap_array_bits(text, int) is 'Return all bits in the bitmap given by BMARRAY[ARR_IDX]. This is primarily intended for interactive use: for debugging, etc.'; @@ -418,12 +418,12 @@ Return the name of BMREF.'; create or replace -function veil.bitmap_hash_testbit(bmhash text, key text, bitno int4) returns bool +function veil.bitmap_hash_testbit(bmhash text, key text, bitno int) returns bool as '@LIBPATH@', 'veil_bitmap_hash_testbit' language C stable strict; -comment on function veil.bitmap_hash_testbit(text, text, int4) is +comment on function veil.bitmap_hash_testbit(text, text, int) is 'Test the bit, in the bitmap from BMHASH identified by KEY, given by BITNO. @@ -431,12 +431,12 @@ Return TRUE if the bit is set, else FALSE.'; create or replace -function veil.bitmap_hash_setbit(bmhash text, key text, bitno int4) returns bool +function veil.bitmap_hash_setbit(bmhash text, key text, bitno int) returns bool as '@LIBPATH@', 'veil_bitmap_hash_setbit' language C stable strict; -comment on function veil.bitmap_hash_setbit(text, text, int4) is +comment on function veil.bitmap_hash_setbit(text, text, int) is 'Set the bit, in the bitmap from BMHASH identified by KEY, given by BITNO to TRUE. @@ -444,12 +444,12 @@ Return TRUE.'; create or replace -function veil.bitmap_hash_clearbit(bmhash text, key text, bitno int4) returns bool +function veil.bitmap_hash_clearbit(bmhash text, key text, bitno int) returns bool as '@LIBPATH@', 'veil_bitmap_hash_clearbit' language C stable strict; -comment on function veil.bitmap_hash_clearbit(text, text, int4) is +comment on function veil.bitmap_hash_clearbit(text, text, int) is 'Set the bit, in the bitmap from BMHASH identified by KEY, given by BITNO to FALSE. @@ -494,7 +494,7 @@ Return TRUE.'; create or replace -function veil.bitmap_hash_bits(bmhash text, key text) returns setof int4 +function veil.bitmap_hash_bits(bmhash text, key text) returns setof int as '@LIBPATH@', 'veil_bitmap_hash_bits' language C stable strict; @@ -524,25 +524,25 @@ comment on function veil.bitmap_hash_entries(text) is create or replace -function veil.int4_set(name text, value int4) returns int4 +function veil.int4_set(name text, value int) returns int as '@LIBPATH@', 'veil_int4_set' language C stable; -comment on function veil.int4_set(text, int4) is -'Set the int4 variable NAME to VALUE. +comment on function veil.int4_set(text, int) is +'Set the int variable NAME to VALUE. Return the new value'; create or replace -function veil.int4_get(name text) returns int4 +function veil.int4_get(name text) returns int as '@LIBPATH@', 'veil_int4_get' language C stable strict; comment on function veil.int4_get(text) is -'Return the value of int4 variable NAME.'; +'Return the value of int variable NAME.'; create or replace @@ -551,7 +551,7 @@ function veil.init_int4array(arrayname text, range text) returns bool language C stable strict; comment on function veil.init_int4array(text, text) is -'Initialise the int4 array ARRAYNAME, with an index range of RANGE. +'Initialise the int array ARRAYNAME, with an index range of RANGE. Each entry in the array is set to zero. @@ -571,24 +571,24 @@ Return TRUE.'; create or replace -function veil.int4array_set(arrayname text, idx int4, value int4) returns int4 +function veil.int4array_set(arrayname text, idx int, value int) returns int as '@LIBPATH@', 'veil_int4array_set' language C stable; -comment on function veil.int4array_set(text, int4, int4) is +comment on function veil.int4array_set(text, int, int) is 'Set the ARRAYNAME element IDX to VALUE. Return the new value.'; create or replace -function veil.int4array_get(arrayname text, idx int4) returns int4 +function veil.int4array_get(arrayname text, idx int) returns int as '@LIBPATH@', 'veil_int4array_get' language C stable strict; -comment on function veil.int4array_get(text, int4) is +comment on function veil.int4array_get(text, int) is 'Return the value of ARRAYNAME element IDX.'; @@ -677,7 +677,7 @@ The value can be restored by de-serializing it.'; create or replace -function veil.deserialise(stream text) returns int4 +function veil.deserialise(stream text) returns int as '@LIBPATH@', 'veil_deserialise' language C stable strict; @@ -690,7 +690,7 @@ Return the number of items de-serialised.'; -- Ditto for victims of webster. create or replace -function veil.deserialize(stream text) returns int4 +function veil.deserialize(stream text) returns int as '@LIBPATH@', 'veil_deserialise' language C stable strict; @@ -703,30 +703,30 @@ Return the number of items de-serialized.'; revoke execute on function veil.share(text) from public; revoke execute on function veil.veil_variables() from public; -revoke execute on function veil.init_range(text, int4, int4) from public; +revoke execute on function veil.init_range(text, int, int) from public; revoke execute on function veil.range(text) from public; revoke execute on function veil.init_bitmap(text, text) from public; revoke execute on function veil.clear_bitmap(text) from public; -revoke execute on function veil.bitmap_setbit(text, int4) from public; -revoke execute on function veil.bitmap_testbit(text, int4) from public; +revoke execute on function veil.bitmap_setbit(text, int) from public; +revoke execute on function veil.bitmap_testbit(text, int) from public; revoke execute on function veil.bitmap_bits(text) from public; revoke execute on function veil.bitmap_range(text) from public; revoke execute on function veil.init_bitmap_array(text, text, text) from public; revoke execute on function veil.clear_bitmap_array(text) from public; -revoke execute on function veil.bitmap_from_array(text, text, int4) +revoke execute on function veil.bitmap_from_array(text, text, int) from public; -revoke execute on function veil.bitmap_array_setbit(text, int4, int4) +revoke execute on function veil.bitmap_array_setbit(text, int, int) from public; -revoke execute on function veil.bitmap_array_testbit(text, int4, int4) +revoke execute on function veil.bitmap_array_testbit(text, int, int) from public; -revoke execute on function veil.union_from_bitmap_array(text, text, int4) +revoke execute on function veil.union_from_bitmap_array(text, text, int) from public; -revoke execute on function veil.intersect_from_bitmap_array(text, text, int4) +revoke execute on function veil.intersect_from_bitmap_array(text, text, int) from public; -revoke execute on function veil.bitmap_array_bits(text, int4) from public; +revoke execute on function veil.bitmap_array_bits(text, int) from public; revoke execute on function veil.bitmap_array_arange(text) from public; revoke execute on function veil.bitmap_array_brange(text) from public; @@ -737,9 +737,9 @@ revoke execute on function veil.bitmap_hash_key_exists(text, text) from public; revoke execute on function veil.bitmap_from_hash(text, text, text) from public; -revoke execute on function veil.bitmap_hash_setbit(text, text, int4) +revoke execute on function veil.bitmap_hash_setbit(text, text, int) from public; -revoke execute on function veil.bitmap_hash_testbit(text, text, int4) +revoke execute on function veil.bitmap_hash_testbit(text, text, int) from public; revoke execute on function veil.union_into_bitmap_hash(text, text, text) from public; @@ -753,8 +753,8 @@ revoke execute on function veil.bitmap_hash_entries(text) from public; revoke execute on function veil.init_int4array(text, text) from public; revoke execute on function veil.clear_int4array(text) from public; -revoke execute on function veil.int4array_set(text, int4, int4) from public; -revoke execute on function veil.int4array_get(text, int4) from public; +revoke execute on function veil.int4array_set(text, int, int) from public; +revoke execute on function veil.int4array_get(text, int) from public; revoke execute on function veil.veil_init(bool) from public; revoke execute on function veil.veil_perform_reset() from public; diff --git a/src/veil_query.d b/src/veil_query.d index dcda96c..e69de29 100644 --- a/src/veil_query.d +++ b/src/veil_query.d @@ -1,5 +0,0 @@ -src/veil_query.o src/veil_query.d: \ - src/veil_query.c \ - src/veil_version.h \ - src/veil_funcs.h \ - src/veil_datatypes.h diff --git a/src/veil_serialise.c b/src/veil_serialise.c index c172444..f0adb7b 100644 --- a/src/veil_serialise.c +++ b/src/veil_serialise.c @@ -30,7 +30,11 @@ #define INT4VAR_HDR 'V' #define INT8VAR_HDR '8' #define RANGE_HDR 'R' +#ifdef USE_64_BIT #define BITMAP_HDR 'B' +#else +#define BITMAP_HDR 'M' +#endif #define BITMAP_ARRAY_HDR 'A' #define BITMAP_HASH_HDR 'H' #define INT4_ARRAY_HDR 'I' @@ -572,8 +576,8 @@ serialise_range(Range *range, char *name) serialise_char(&stream, RANGE_HDR); serialise_name(&stream, name); - serialise_int8(&stream, range->min); - serialise_int8(&stream, range->max); + serialise_int4(&stream, range->min); + serialise_int4(&stream, range->max); return streamstart; } @@ -602,8 +606,8 @@ deserialise_range(char **p_stream) range = (Range *) var->obj; } - range->min = deserialise_int8(p_stream); - range->max = deserialise_int8(p_stream); + range->min = deserialise_int4(p_stream); + range->max = deserialise_int4(p_stream); return var; } @@ -621,7 +625,7 @@ serialise_one_bitmap(char **p_stream, Bitmap *bitmap) int elems = ARRAYELEMS(bitmap->bitzero, bitmap->bitmax); serialise_int4(p_stream, bitmap->bitzero); serialise_int4(p_stream, bitmap->bitmax); - serialise_stream(p_stream, elems * sizeof(int32), + serialise_stream(p_stream, elems * sizeof(bm_int), (char *) &(bitmap->bitset)); } @@ -639,7 +643,7 @@ serialise_bitmap(Bitmap *bitmap, char *name) { int elems = ARRAYELEMS(bitmap->bitzero, bitmap->bitmax); int stream_len = hdrlen(name) + (INT32SIZE_B64 * 2) + - streamlen(sizeof(int32) * elems) + 1; + streamlen(sizeof(bm_int) * elems) + 1; char *stream = palloc(stream_len * sizeof(char)); char *streamstart = stream; @@ -723,7 +727,7 @@ serialise_bitmap_array(BitmapArray *bmarray, char *name) int bitset_elems = ARRAYELEMS(bmarray->bitzero, bmarray->bitmax); int array_elems = 1 + bmarray->arraymax - bmarray->arrayzero; int bitmap_len = (INT32SIZE_B64 * 2) + - streamlen(sizeof(int32) * bitset_elems); + streamlen(sizeof(bm_int) * bitset_elems); int stream_len = hdrlen(name) + (INT32SIZE_B64 * 4) + (bitmap_len * array_elems) + 1; int idx; diff --git a/src/veil_shmem.d b/src/veil_shmem.d index 5d3ab9f..e69de29 100644 --- a/src/veil_shmem.d +++ b/src/veil_shmem.d @@ -1,6 +0,0 @@ -src/veil_shmem.o src/veil_shmem.d: \ - src/veil_shmem.c \ - src/veil_version.h \ - src/veil_shmem.h \ - src/veil_funcs.h \ - src/veil_datatypes.h diff --git a/src/veil_utils.d b/src/veil_utils.d index 074fe42..e69de29 100644 --- a/src/veil_utils.d +++ b/src/veil_utils.d @@ -1,4 +0,0 @@ -src/veil_utils.o src/veil_utils.d: \ - src/veil_utils.c \ - src/veil_funcs.h \ - src/veil_datatypes.h diff --git a/src/veil_variables.d b/src/veil_variables.d index 09fb2d8..e69de29 100644 --- a/src/veil_variables.d +++ b/src/veil_variables.d @@ -1,4 +0,0 @@ -src/veil_variables.o src/veil_variables.d: \ - src/veil_variables.c \ - src/veil_datatypes.h \ - src/veil_funcs.h