Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitdcbbdb1

Browse files
committed
Add appropriately ifdef'd hack to make ARM compiler allocate ItemPointerData
as six bytes not eight. This fixes a regression test failure but moreimportantly avoids wasting four bytes of pad space in every tuple header.Also add some commentary about what's going on.
1 parentd0f6ae6 commitdcbbdb1

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

‎src/include/storage/itemptr.h

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
10-
* $Id: itemptr.h,v 1.17 2001/03/22 04:01:06 momjian Exp $
10+
* $Id: itemptr.h,v 1.18 2001/03/30 05:25:51 tgl Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -20,15 +20,29 @@
2020
/*
2121
* ItemPointer:
2222
*
23-
* this is a pointer to an item on another disk page in the same file.
23+
* This is a pointer to an item within a disk page of a known file
24+
* (for example, a cross-link from an index to its parent table).
2425
* blkid tells us which block, posid tells us which entry in the linp
2526
* (ItemIdData) array we want.
27+
*
28+
* Note: because there is an item pointer in each tuple header and index
29+
* tuple header on disk, it's very important not to waste space with
30+
* structure padding bytes. The struct is designed to be six bytes long
31+
* (it contains three int16 fields) but a few compilers will pad it to
32+
* eight bytes unless coerced. We apply appropriate persuasion where
33+
* possible, and to cope with unpersuadable compilers, we try to use
34+
* "SizeOfIptrData" rather than "sizeof(ItemPointerData)" when computing
35+
* on-disk sizes.
2636
*/
2737
typedefstructItemPointerData
2838
{
2939
BlockIdDataip_blkid;
3040
OffsetNumberip_posid;
31-
}ItemPointerData;
41+
}
42+
#ifdef__arm__
43+
__attribute__((packed))/* Appropriate whack upside the head for ARM */
44+
#endif
45+
ItemPointerData;
3246

3347
#defineSizeOfIptrData\
3448
(offsetof(ItemPointerData, ip_posid) + sizeof(OffsetNumber))

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp