@@ -66,11 +66,11 @@ class BCBHashTable;
6666
6767// Page buffer cache size constraints.
6868
69- const ULONG MIN_PAGE_BUFFERS = 50 ;
69+ inline constexpr ULONG MIN_PAGE_BUFFERS = 50 ;
7070#if SIZEOF_VOID_P == 4
71- const ULONG MAX_PAGE_BUFFERS = 131072 ;
71+ inline constexpr ULONG MAX_PAGE_BUFFERS = 131072 ;
7272#else
73- const ULONG MAX_PAGE_BUFFERS = MAX_SLONG - 1 ;
73+ inline constexpr ULONG MAX_PAGE_BUFFERS = MAX_SLONG - 1 ;
7474#endif
7575
7676// BufferControl -- Buffer control block -- one per system
@@ -174,16 +174,16 @@ class BufferControl : public pool_alloc<type_bcb>
174174 Firebird::Array<BDBBlock> bcb_bdbBlocks; // all allocated BufferDesc's
175175};
176176
177- const int BCB_keep_pages = 1 ; // set during btc_flush(), pages not removed from dirty binary tree
178- const int BCB_cache_writer = 2 ; // cache writer thread has been started
179- const int BCB_writer_start = 4 ; // cache writer thread is starting now
180- const int BCB_writer_active = 8 ; // no need to post writer event count
177+ inline constexpr int BCB_keep_pages = 1 ; // set during btc_flush(), pages not removed from dirty binary tree
178+ inline constexpr int BCB_cache_writer = 2 ; // cache writer thread has been started
179+ inline constexpr int BCB_writer_start = 4 ; // cache writer thread is starting now
180+ inline constexpr int BCB_writer_active = 8 ; // no need to post writer event count
181181#ifdef SUPERSERVER_V2
182- const int BCB_cache_reader = 16 ; // cache reader thread has been started
183- const int BCB_reader_active = 32 ; // cache reader not blocked on event
182+ inline constexpr int BCB_cache_reader = 16 ; // cache reader thread has been started
183+ inline constexpr int BCB_reader_active = 32 ; // cache reader not blocked on event
184184#endif
185- const int BCB_free_pending = 64 ; // request cache writer to free pages
186- const int BCB_exclusive = 128 ; // there is only BCB in whole system
185+ inline constexpr int BCB_free_pending = 64 ; // request cache writer to free pages
186+ inline constexpr int BCB_exclusive = 128 ; // there is only BCB in whole system
187187
188188
189189// BufferDesc -- Buffer descriptor block
@@ -273,28 +273,28 @@ class BufferDesc : public pool_alloc<type_bdb>
273273
274274// to set/clear BDB_dirty use set_dirty_flag()/clear_dirty_flag()
275275// These constants should really be of type USHORT.
276- const int BDB_dirty = 0x0001 ; // page has been updated but not written yet
277- const int BDB_garbage_collect = 0x0002 ; // left by scan for garbage collector
278- const int BDB_writer = 0x0004 ; // someone is updating the page
279- const int BDB_marked = 0x0008 ; // page has been updated
280- const int BDB_must_write = 0x0010 ; // forces a write as soon as the page is released
281- const int BDB_faked = 0x0020 ; // page was just allocated
282- // const int BDB_merge = 0x0040;
283- const int BDB_system_dirty = 0x0080 ; // system transaction has marked dirty
284- const int BDB_io_error = 0x0100 ; // page i/o error
285- const int BDB_read_pending = 0x0200 ; // read is pending
286- const int BDB_free_pending = 0x0400 ; // buffer being freed for reuse
287- const int BDB_not_valid = 0x0800 ; // i/o error invalidated buffer
288- const int BDB_db_dirty = 0x1000 ; // page must be written to database
289- // const int BDB_checkpoint = 0x2000; // page must be written by next checkpoint
290- const int BDB_prefetch = 0x4000 ; // page has been prefetched but not yet referenced
291- const int BDB_no_blocking_ast = 0x8000 ; // No blocking AST registered with page lock
292- const int BDB_lru_chained = 0x10000 ; // buffer is in pending LRU chain
293- const int BDB_nbak_state_lock = 0x20000 ; // nbak state lock should be released after buffer is written
276+ inline constexpr int BDB_dirty = 0x0001 ; // page has been updated but not written yet
277+ inline constexpr int BDB_garbage_collect = 0x0002 ; // left by scan for garbage collector
278+ inline constexpr int BDB_writer = 0x0004 ; // someone is updating the page
279+ inline constexpr int BDB_marked = 0x0008 ; // page has been updated
280+ inline constexpr int BDB_must_write = 0x0010 ; // forces a write as soon as the page is released
281+ inline constexpr int BDB_faked = 0x0020 ; // page was just allocated
282+ // inline constexpr int BDB_merge = 0x0040;
283+ inline constexpr int BDB_system_dirty = 0x0080 ; // system transaction has marked dirty
284+ inline constexpr int BDB_io_error = 0x0100 ; // page i/o error
285+ inline constexpr int BDB_read_pending = 0x0200 ; // read is pending
286+ inline constexpr int BDB_free_pending = 0x0400 ; // buffer being freed for reuse
287+ inline constexpr int BDB_not_valid = 0x0800 ; // i/o error invalidated buffer
288+ inline constexpr int BDB_db_dirty = 0x1000 ; // page must be written to database
289+ // inline constexpr int BDB_checkpoint = 0x2000; // page must be written by next checkpoint
290+ inline constexpr int BDB_prefetch = 0x4000 ; // page has been prefetched but not yet referenced
291+ inline constexpr int BDB_no_blocking_ast = 0x8000 ; // No blocking AST registered with page lock
292+ inline constexpr int BDB_lru_chained = 0x10000 ; // buffer is in pending LRU chain
293+ inline constexpr int BDB_nbak_state_lock = 0x20000 ; // nbak state lock should be released after buffer is written
294294
295295// bdb_ast_flags
296296
297- const int BDB_blocking = 0x01 ; // a blocking ast was sent while page locked
297+ inline constexpr int BDB_blocking = 0x01 ; // a blocking ast was sent while page locked
298298
299299
300300// PRE -- Precedence block
@@ -309,7 +309,7 @@ class Precedence : public pool_alloc<type_pre>
309309 SSHORT pre_flags;
310310};
311311
312- const int PRE_cleared = 1 ;
312+ inline constexpr int PRE_cleared = 1 ;
313313
314314/* Compatibility matrix for latch types.
315315
@@ -353,9 +353,9 @@ enum LATCH
353353
354354// Constants used by prefetch mechanism
355355
356- const int PREFETCH_MAX_TRANSFER = 16384 ; // maximum block I/O transfer (bytes)
356+ inline constexpr int PREFETCH_MAX_TRANSFER = 16384 ; // maximum block I/O transfer (bytes)
357357// maximum pages allowed per prefetch request
358- const int PREFETCH_MAX_PAGES = (2 * PREFETCH_MAX_TRANSFER / MIN_PAGE_SIZE);
358+ inline constexpr int PREFETCH_MAX_PAGES = (2 * PREFETCH_MAX_TRANSFER / MIN_PAGE_SIZE);
359359
360360// Prefetch block
361361
@@ -374,7 +374,7 @@ class Prefetch : public pool_alloc<type_prf>
374374 SCHAR prf_unaligned_buffer[PREFETCH_MAX_TRANSFER + MIN_PAGE_SIZE];
375375};
376376
377- const int PRF_active = 1 ; // prefetch block currently in use
377+ inline constexpr int PRF_active = 1 ; // prefetch block currently in use
378378#endif // SUPERSERVER_V2
379379
380380typedef Firebird::SortedArray<SLONG, Firebird::InlineStorage<SLONG, 256 >, SLONG> PagesArray;
0 commit comments