Install new alignment code to use MAXALIGN rather than DOUBLEALIGN where

approproate.
This commit is contained in:
Bruce Momjian 1999-07-19 07:07:29 +00:00
parent e259780b13
commit faf7d78174
19 changed files with 70 additions and 69 deletions

View File

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/common/heaptuple.c,v 1.57 1999/07/17 20:16:35 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/access/common/heaptuple.c,v 1.58 1999/07/19 07:07:15 momjian Exp $
*
* NOTES
* The old interface functions have been converted to macros
@ -677,7 +677,7 @@ heap_formtuple(TupleDesc tupleDescriptor,
len += bitmaplen;
}
hoff = len = DOUBLEALIGN(len); /* be conservative here */
hoff = len = MAXALIGN(len); /* be conservative here */
len += ComputeDataSize(tupleDescriptor, value, nulls);
@ -811,7 +811,7 @@ heap_addheader(uint32 natts, /* max domain index */
len = offsetof(HeapTupleHeaderData, t_bits);
hoff = len = DOUBLEALIGN(len); /* be conservative */
hoff = len = MAXALIGN(len); /* be conservative */
len += structlen;
tuple = (HeapTuple) palloc(HEAPTUPLESIZE + len);
td = tuple->t_data = (HeapTupleHeader) ((char *) tuple + HEAPTUPLESIZE);

View File

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/common/indextuple.c,v 1.37 1999/07/17 20:16:35 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/access/common/indextuple.c,v 1.38 1999/07/19 07:07:15 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -60,7 +60,7 @@ index_formtuple(TupleDesc tupleDescriptor,
hoff = IndexInfoFindDataOffset(infomask);
size = hoff + ComputeDataSize(tupleDescriptor, value, null);
size = DOUBLEALIGN(size); /* be conservative */
size = MAXALIGN(size); /* be conservative */
tp = (char *) palloc(size);
tuple = (IndexTuple) tp;

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/hash/hashinsert.c,v 1.17 1999/07/15 23:02:54 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/access/hash/hashinsert.c,v 1.18 1999/07/19 07:07:16 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -128,7 +128,7 @@ _hash_insertonpg(Relation rel,
itemsz = IndexTupleDSize(hitem->hash_itup)
+ (sizeof(HashItemData) - sizeof(IndexTupleData));
itemsz = DOUBLEALIGN(itemsz);
itemsz = MAXALIGN(itemsz);
while (PageGetFreeSpace(page) < itemsz)
{

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/hash/hashovfl.c,v 1.24 1999/07/17 20:16:38 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/access/hash/hashovfl.c,v 1.25 1999/07/19 07:07:16 momjian Exp $
*
* NOTES
* Overflow pages look like ordinary relation pages.
@ -531,7 +531,7 @@ _hash_squeezebucket(Relation rel,
hitem = (HashItem) PageGetItem(rpage, PageGetItemId(rpage, roffnum));
itemsz = IndexTupleDSize(hitem->hash_itup)
+ (sizeof(HashItemData) - sizeof(IndexTupleData));
itemsz = DOUBLEALIGN(itemsz);
itemsz = MAXALIGN(itemsz);
/*
* walk up the bucket chain, looking for a page big enough for

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/hash/hashpage.c,v 1.24 1999/07/17 20:16:39 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/access/hash/hashpage.c,v 1.25 1999/07/19 07:07:17 momjian Exp $
*
* NOTES
* Postgres hash pages look like ordinary relation pages. The opaque
@ -96,8 +96,8 @@ _hash_metapinit(Relation rel)
for (i = metap->hashm_bshift; i > 0; --i)
{
if ((1 << i) < (metap->hashm_bsize -
(DOUBLEALIGN(sizeof(PageHeaderData)) +
DOUBLEALIGN(sizeof(HashPageOpaqueData)))))
(MAXALIGN(sizeof(PageHeaderData)) +
MAXALIGN(sizeof(HashPageOpaqueData)))))
break;
}
Assert(i);
@ -605,7 +605,7 @@ _hash_splitpage(Relation rel,
itemsz = IndexTupleDSize(hitem->hash_itup)
+ (sizeof(HashItemData) - sizeof(IndexTupleData));
itemsz = DOUBLEALIGN(itemsz);
itemsz = MAXALIGN(itemsz);
if (PageGetFreeSpace(npage) < itemsz)
{

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/hash/hashutil.c,v 1.21 1999/07/17 20:16:39 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/access/hash/hashutil.c,v 1.22 1999/07/19 07:07:17 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -127,9 +127,9 @@ _hash_checkpage(Page page, int flags)
Assert(((PageHeader) (page))->pd_lower >= (sizeof(PageHeaderData) - sizeof(ItemIdData)));
#if 1
Assert(((PageHeader) (page))->pd_upper <=
(BLCKSZ - DOUBLEALIGN(sizeof(HashPageOpaqueData))));
(BLCKSZ - MAXALIGN(sizeof(HashPageOpaqueData))));
Assert(((PageHeader) (page))->pd_special ==
(BLCKSZ - DOUBLEALIGN(sizeof(HashPageOpaqueData))));
(BLCKSZ - MAXALIGN(sizeof(HashPageOpaqueData))));
Assert(((PageHeader) (page))->pd_opaque.od_pagesize == BLCKSZ);
#endif
if (flags)

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/heap/heapam.c,v 1.52 1999/07/17 20:16:39 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/access/heap/heapam.c,v 1.53 1999/07/19 07:07:18 momjian Exp $
*
*
* INTERFACE ROUTINES
@ -1280,7 +1280,7 @@ l2:
HEAP_XMAX_INVALID | HEAP_MARKED_FOR_UPDATE);
/* insert new item */
if ((unsigned) DOUBLEALIGN(newtup->t_len) <= PageGetFreeSpace((Page) dp))
if ((unsigned) MAXALIGN(newtup->t_len) <= PageGetFreeSpace((Page) dp))
RelationPutHeapTuple(relation, buffer, newtup);
else
{

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Id: hio.c,v 1.25 1999/07/16 04:58:27 momjian Exp $
* $Id: hio.c,v 1.26 1999/07/19 07:07:18 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -50,7 +50,7 @@ RelationPutHeapTuple(Relation relation,
IncrHeapAccessStat(global_RelationPutHeapTuple);
pageHeader = (Page) BufferGetPage(buffer);
len = (unsigned) DOUBLEALIGN(tuple->t_len); /* be conservative */
len = (unsigned) MAXALIGN(tuple->t_len); /* be conservative */
Assert((int) len <= PageGetFreeSpace(pageHeader));
offnum = PageAddItem((Page) pageHeader, (Item) tuple->t_data,
@ -143,7 +143,7 @@ RelationPutHeapTupleAtEnd(Relation relation, HeapTuple tuple)
LockBuffer(buffer, BUFFER_LOCK_EXCLUSIVE);
pageHeader = (Page) BufferGetPage(buffer);
len = (unsigned) DOUBLEALIGN(tuple->t_len); /* be conservative */
len = (unsigned) MAXALIGN(tuple->t_len); /* be conservative */
/*
* Note that this is true if the above returned a bogus page, which it

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtinsert.c,v 1.48 1999/07/17 20:16:42 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtinsert.c,v 1.49 1999/07/19 07:07:19 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -263,7 +263,7 @@ _bt_insertonpg(Relation rel,
itemsz = IndexTupleDSize(btitem->bti_itup)
+ (sizeof(BTItemData) - sizeof(IndexTupleData));
itemsz = DOUBLEALIGN(itemsz); /* be safe, PageAddItem will do
itemsz = MAXALIGN(itemsz); /* be safe, PageAddItem will do
* this but we need to be
* consistent */
@ -369,7 +369,7 @@ _bt_insertonpg(Relation rel,
if (currsize > maxsize)
maxsize = currsize;
maxsize += sizeof(PageHeaderData) +
DOUBLEALIGN(sizeof(BTPageOpaqueData));
MAXALIGN(sizeof(BTPageOpaqueData));
if (maxsize >= PageGetPageSize(page) / 2)
do_split = true;
}
@ -460,7 +460,7 @@ _bt_insertonpg(Relation rel,
maxoff = PageGetMaxOffsetNumber(page);
llimit = PageGetPageSize(page) - sizeof(PageHeaderData) -
DOUBLEALIGN(sizeof(BTPageOpaqueData))
MAXALIGN(sizeof(BTPageOpaqueData))
+sizeof(ItemIdData);
llimit /= 2;
firstright = _bt_findsplitloc(rel, page, start, maxoff, llimit);
@ -689,8 +689,8 @@ l_spl: ;
* then we must forse insertion.
*/
if (!parent_chained &&
DOUBLEALIGN(IndexTupleDSize(lowLeftItem->bti_itup)) ==
DOUBLEALIGN(IndexTupleDSize(stack->bts_btitem->bti_itup)))
MAXALIGN(IndexTupleDSize(lowLeftItem->bti_itup)) ==
MAXALIGN(IndexTupleDSize(stack->bts_btitem->bti_itup)))
{
_bt_updateitem(rel, keysz, pbuf,
stack->bts_btitem, lowLeftItem);
@ -1591,7 +1591,7 @@ _bt_shift(Relation rel, Buffer buf, BTStack stack, int keysz,
/* add passed hikey */
itemsz = IndexTupleDSize(hikey->bti_itup)
+ (sizeof(BTItemData) - sizeof(IndexTupleData));
itemsz = DOUBLEALIGN(itemsz);
itemsz = MAXALIGN(itemsz);
if (PageAddItem(page, (Item) hikey, itemsz, P_HIKEY, LP_USED) == InvalidOffsetNumber)
elog(FATAL, "btree: failed to add hikey in _bt_shift");
pfree(hikey);
@ -1599,7 +1599,7 @@ _bt_shift(Relation rel, Buffer buf, BTStack stack, int keysz,
/* add btitem */
itemsz = IndexTupleDSize(btitem->bti_itup)
+ (sizeof(BTItemData) - sizeof(IndexTupleData));
itemsz = DOUBLEALIGN(itemsz);
itemsz = MAXALIGN(itemsz);
if (PageAddItem(page, (Item) btitem, itemsz, P_FIRSTKEY, LP_USED) == InvalidOffsetNumber)
elog(FATAL, "btree: failed to add firstkey in _bt_shift");
pfree(btitem);

View File

@ -5,7 +5,7 @@
*
*
* IDENTIFICATION
* $Id: nbtsort.c,v 1.45 1999/07/17 20:16:43 momjian Exp $
* $Id: nbtsort.c,v 1.46 1999/07/19 07:07:19 momjian Exp $
*
* NOTES
*
@ -86,7 +86,7 @@ extern int NDirectFileWrite;
* are potentially reading a bunch of zeroes off of disk in many
* cases.
*
* BTItems are packed in and DOUBLEALIGN'd.
* BTItems are packed in and MAXALIGN'd.
*
* the fd should not be going out to disk, strictly speaking, but it's
* the only thing like that so i'm not going to worry about wasting a
@ -497,7 +497,7 @@ _bt_tapenext(BTTapeBlock *tape, char **pos)
return (BTItem) NULL;
bti = (BTItem) *pos;
itemsz = BTITEMSZ(bti);
*pos += DOUBLEALIGN(itemsz);
*pos += MAXALIGN(itemsz);
return bti;
}
@ -517,7 +517,7 @@ _bt_tapeadd(BTTapeBlock *tape, BTItem item, int itemsz)
{
memcpy(tape->bttb_data + tape->bttb_top, item, itemsz);
++tape->bttb_ntup;
tape->bttb_top += DOUBLEALIGN(itemsz);
tape->bttb_top += MAXALIGN(itemsz);
}
/*-------------------------------------------------------------------------
@ -653,7 +653,7 @@ _bt_spool(Relation index, BTItem btitem, void *spool)
itape = btspool->bts_itape[btspool->bts_tape];
itemsz = BTITEMSZ(btitem);
itemsz = DOUBLEALIGN(itemsz);
itemsz = MAXALIGN(itemsz);
/*
* if this buffer is too full for this BTItemData, or if we have run
@ -693,7 +693,7 @@ _bt_spool(Relation index, BTItem btitem, void *spool)
* BTItemDatas in the order dictated by the sorted array of
* BTItems, not the original order.
*
* (since everything was DOUBLEALIGN'd and is all on a single tape
* (since everything was MAXALIGN'd and is all on a single tape
* block, everything had *better* still fit on one tape block..)
*/
otape = btspool->bts_otape[btspool->bts_tape];
@ -701,7 +701,7 @@ _bt_spool(Relation index, BTItem btitem, void *spool)
{
bti = parray[i].btsk_item;
btisz = BTITEMSZ(bti);
btisz = DOUBLEALIGN(btisz);
btisz = MAXALIGN(btisz);
_bt_tapeadd(otape, bti, btisz);
#if defined(FASTBUILD_DEBUG) && defined(FASTBUILD_SPOOL)
{
@ -903,7 +903,7 @@ _bt_buildadd(Relation index, void *pstate, BTItem bti, int flags)
pgspc = PageGetFreeSpace(npage);
btisz = BTITEMSZ(bti);
btisz = DOUBLEALIGN(btisz);
btisz = MAXALIGN(btisz);
if (pgspc < btisz)
{
Buffer obuf = nbuf;
@ -1221,7 +1221,7 @@ _bt_merge(Relation index, BTSpool *btspool)
if (bti != (BTItem) NULL)
{
btisz = BTITEMSZ(bti);
btisz = DOUBLEALIGN(btisz);
btisz = MAXALIGN(btisz);
if (doleaf)
{
_bt_buildadd(index, state, bti, BTP_LEAF);

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.114 1999/07/17 20:16:54 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.115 1999/07/19 07:07:20 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -1282,9 +1282,9 @@ vc_rpfheap(VRelStats *vacrelstats, Relation onerel,
to_item = i;
to_vpd = fraged_pages->vpl_pagedesc[to_item];
}
to_vpd->vpd_free -= DOUBLEALIGN(tlen);
to_vpd->vpd_free -= MAXALIGN(tlen);
if (to_vpd->vpd_offsets_used >= to_vpd->vpd_offsets_free)
to_vpd->vpd_free -= DOUBLEALIGN(sizeof(ItemIdData));
to_vpd->vpd_free -= MAXALIGN(sizeof(ItemIdData));
(to_vpd->vpd_offsets_used)++;
if (free_vtmove == 0)
{
@ -2790,7 +2790,7 @@ static bool
vc_enough_space(VPageDescr vpd, Size len)
{
len = DOUBLEALIGN(len);
len = MAXALIGN(len);
if (len > vpd->vpd_free)
return false;
@ -2800,7 +2800,7 @@ vc_enough_space(VPageDescr vpd, Size len)
return true; /* and len <= free_space */
/* ok. noff_usd >= noff_free and so we'll have to allocate new itemid */
if (len + DOUBLEALIGN(sizeof(ItemIdData)) <= vpd->vpd_free)
if (len + MAXALIGN(sizeof(ItemIdData)) <= vpd->vpd_free)
return true;
return false;

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteDefine.c,v 1.34 1999/07/17 20:17:36 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteDefine.c,v 1.35 1999/07/19 07:07:21 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -108,8 +108,9 @@ InsertRule(char *rulname,
(rulename, ev_type, ev_class, ev_attr, ev_action, ev_qual, is_instead) VALUES \
('%s', %d::char, %u::oid, %d::int2, '%s'::text, '%s'::text, \
'%s'::bool);";
if (sizeof(FormData_pg_rewrite) + strlen(actionbuf) +
strlen(qualbuf) > MaxAttrSize)
if (MAXALIGN(sizeof(FormData_pg_rewrite)) +
MAXALIGN(strlen(actionbuf)) +
MAXALIGN(strlen(qualbuf)) > MaxAttrSize)
elog(ERROR, "DefineQueryRewrite: rule plan string too big.");
sprintf(rulebuf, template,
rulname, evtype, eventrel_oid, evslot_index, actionbuf,

View File

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/storage/large_object/inv_api.c,v 1.57 1999/07/17 20:17:45 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/storage/large_object/inv_api.c,v 1.58 1999/07/19 07:07:23 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -57,8 +57,8 @@
*/
#define IFREESPC(p) (PageGetFreeSpace(p) - \
DOUBLEALIGN(offsetof(HeapTupleHeaderData,t_bits)) - \
DOUBLEALIGN(sizeof(struct varlena) + sizeof(int32)) - \
MAXALIGN(offsetof(HeapTupleHeaderData,t_bits)) - \
MAXALIGN(sizeof(struct varlena) + sizeof(int32)) - \
sizeof(double))
#define IMAXBLK 8092
#define IMINBLK 512
@ -1005,11 +1005,11 @@ inv_newtuple(LargeObjectDesc *obj_desc,
/* compute tuple size -- no nulls */
hoff = offsetof(HeapTupleHeaderData, t_bits);
hoff = DOUBLEALIGN(hoff);
hoff = MAXALIGN(hoff);
/* add in olastbyte, varlena.vl_len, varlena.vl_dat */
tupsize = hoff + (2 * sizeof(int32)) + nwrite;
tupsize = DOUBLEALIGN(tupsize);
tupsize = MAXALIGN(tupsize);
/*
* Allocate the tuple on the page, violating the page abstraction.

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/storage/page/bufpage.c,v 1.26 1999/07/17 20:17:48 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/storage/page/bufpage.c,v 1.27 1999/07/19 07:07:24 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -41,7 +41,7 @@ PageInit(Page page, Size pageSize, Size specialSize)
Assert(pageSize >
specialSize + sizeof(PageHeaderData) - sizeof(ItemIdData));
specialSize = DOUBLEALIGN(specialSize);
specialSize = MAXALIGN(specialSize);
p->pd_lower = sizeof(PageHeaderData) - sizeof(ItemIdData);
p->pd_upper = pageSize - specialSize;
@ -149,7 +149,7 @@ PageAddItem(Page page,
else
lower = ((PageHeader) page)->pd_lower;
alignedSize = DOUBLEALIGN(size);
alignedSize = MAXALIGN(size);
upper = ((PageHeader) page)->pd_upper - alignedSize;
@ -190,12 +190,12 @@ PageGetTempPage(Page page, Size specialSize)
/* clear out the middle */
size = (pageSize - sizeof(PageHeaderData)) + sizeof(ItemIdData);
size -= DOUBLEALIGN(specialSize);
size -= MAXALIGN(specialSize);
MemSet((char *) &(thdr->pd_linp[0]), 0, size);
/* set high, low water marks */
thdr->pd_lower = sizeof(PageHeaderData) - sizeof(ItemIdData);
thdr->pd_upper = pageSize - DOUBLEALIGN(specialSize);
thdr->pd_upper = pageSize - MAXALIGN(specialSize);
return temp;
}
@ -307,7 +307,7 @@ PageRepairFragmentation(Page page)
for (i = 0, itemidptr = itemidbase; i < nused; i++, itemidptr++)
{
lp = ((PageHeader) page)->pd_linp + itemidptr->offsetindex;
alignedSize = DOUBLEALIGN((*lp).lp_len);
alignedSize = MAXALIGN((*lp).lp_len);
upper = ((PageHeader) page)->pd_upper - alignedSize;
memmove((char *) page + upper,
(char *) page + (*lp).lp_off,
@ -381,7 +381,7 @@ PageIndexTupleDelete(Page page, OffsetNumber offnum)
tup = PageGetItemId(page, offnum);
size = ItemIdGetLength(tup);
size = DOUBLEALIGN(size);
size = MAXALIGN(size);
/* location of deleted tuple data */
locn = (char *) (page + ItemIdGetOffset(tup));

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/arrayfuncs.c,v 1.47 1999/07/17 20:17:53 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/adt/arrayfuncs.c,v 1.48 1999/07/19 07:07:25 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -472,7 +472,7 @@ _ReadArrayStr(char *arrayStr,
if (values[i])
{
if (typalign == 'd')
*nbytes += DOUBLEALIGN(*(int32 *) values[i]);
*nbytes += MAXALIGN(*(int32 *) values[i]);
else
*nbytes += INTALIGN(*(int32 *) values[i]);
}

View File

@ -6,7 +6,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: hash.h,v 1.27 1999/07/16 17:07:26 momjian Exp $
* $Id: hash.h,v 1.28 1999/07/19 07:07:27 momjian Exp $
*
* NOTES
* modeled after Margo Seltzer's hash implementation for unix.
@ -202,7 +202,7 @@ typedef HashItemData *HashItem;
#define BMPGSZ_BYTE(metap) ((metap)->hashm_bmsize)
#define BMPGSZ_BIT(metap) ((metap)->hashm_bmsize << BYTE_TO_BIT)
#define HashPageGetBitmap(pg) \
((uint32 *) (((char *) (pg)) + DOUBLEALIGN(sizeof(PageHeaderData))))
((uint32 *) (((char *) (pg)) + MAXALIGN(sizeof(PageHeaderData))))
/*
* The number of bits in an ovflpage bitmap which

View File

@ -6,7 +6,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: htup.h,v 1.24 1999/07/15 23:03:34 momjian Exp $
* $Id: htup.h,v 1.25 1999/07/19 07:07:28 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -88,7 +88,7 @@ typedef struct HeapTupleData
typedef HeapTupleData *HeapTuple;
#define HEAPTUPLESIZE DOUBLEALIGN(sizeof(HeapTupleData))
#define HEAPTUPLESIZE MAXALIGN(sizeof(HeapTupleData))
/* ----------------

View File

@ -6,7 +6,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: itup.h,v 1.20 1999/07/16 17:07:27 momjian Exp $
* $Id: itup.h,v 1.21 1999/07/19 07:07:28 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -103,7 +103,7 @@ typedef struct PredInfo
) \
: \
( \
(Size)DOUBLEALIGN(sizeof(IndexTupleData) + sizeof(IndexAttributeBitMapData)) \
(Size)MAXALIGN(sizeof(IndexTupleData) + sizeof(IndexAttributeBitMapData)) \
) \
)

View File

@ -10,7 +10,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: array.h,v 1.20 1999/07/17 20:18:35 momjian Exp $
* $Id: array.h,v 1.21 1999/07/19 07:07:29 momjian Exp $
*
* NOTES
* XXX the data array should be LONGALIGN'd -- notice that the array
@ -84,13 +84,13 @@ typedef struct
*/
#define ARR_DATA_PTR(a) \
(((char *) a) + \
DOUBLEALIGN(sizeof(ArrayType) + 2 * (sizeof(int) * (a)->ndim)))
MAXALIGN(sizeof(ArrayType) + 2 * (sizeof(int) * (a)->ndim)))
/*
* The total array header size for an array of dimension n (in bytes).
*/
#define ARR_OVERHEAD(n) \
(DOUBLEALIGN(sizeof(ArrayType) + 2 * (n) * sizeof(int)))
(MAXALIGN(sizeof(ArrayType) + 2 * (n) * sizeof(int)))
/*------------------------------------------------------------------------
* Miscellaneous helper definitions and routines for arrayfuncs.c