Skip to content

Commit 8d06637

Browse files
committed
Limit maximum size on 32bit builds && fix elog message.
1 parent a0d5a20 commit 8d06637

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

engine.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ ptrackMapReadFromFile(const char *ptrack_path)
154154
* file size was already checked in ptrackMapInit()
155155
*/
156156
elog(ERROR, "ptrack read map: unexpected end of file while reading map file \"%s\", expected to read %zu, but read only %zu bytes",
157-
ptrack_path, PtrackActualSize, readed);
157+
ptrack_path, (size_t)PtrackActualSize, readed);
158158
}
159159
else if (last_readed < 0 && errno != EINTR)
160160
{

ptrack.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,11 @@ _PG_init(void)
106106
NULL,
107107
&ptrack_map_size_tmp,
108108
0,
109+
#if SIZEOF_SIZE_T == 8
109110
0, 32 * 1024, /* limit to 32 GB */
111+
#else
112+
0, 256, /* limit to 256 MB */
113+
#endif
110114
PGC_POSTMASTER,
111115
GUC_UNIT_MB,
112116
NULL,

0 commit comments

Comments
 (0)