From 1c1dbeae5b7c577b1e33b2eb52a8517483921787 Mon Sep 17 00:00:00 2001 From: hvlad Date: Sun, 6 Sep 2009 09:39:40 +0000 Subject: [PATCH] Improvement CORE-1687 : Allow bigger cache sizes than 2 GB (16K * 128 K) for x64 builds --- src/jrd/cch.cpp | 4 ++-- src/jrd/cch.h | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/jrd/cch.cpp b/src/jrd/cch.cpp index 2ef28d3c36..5757bbf61c 100644 --- a/src/jrd/cch.cpp +++ b/src/jrd/cch.cpp @@ -5515,8 +5515,8 @@ static ULONG memory_init(thread_db* tdbb, BufferControl* bcb, SLONG number) UCHAR* memory = NULL; SLONG buffers = 0; - const SLONG page_size = (SLONG) dbb->dbb_page_size; - SLONG memory_size = page_size * (number + 1); + const size_t page_size = dbb->dbb_page_size; + size_t memory_size = page_size * (number + 1); fb_assert(memory_size > 0); SLONG old_buffers = 0; diff --git a/src/jrd/cch.h b/src/jrd/cch.h index 58ae34d1c5..91a65a50c1 100644 --- a/src/jrd/cch.h +++ b/src/jrd/cch.h @@ -66,7 +66,11 @@ class Database; // Page buffer cache size constraints. const ULONG MIN_PAGE_BUFFERS = 50; +#if SIZEOF_VOID_P == 4 const ULONG MAX_PAGE_BUFFERS = 131072; +#else +const ULONG MAX_PAGE_BUFFERS = MAX_SLONG - 1; +#endif #define DIRTY_LIST //#define DIRTY_TREE