Commit 5c7fb887 authored by marko's avatar marko

branches/zip: Allow the uncompressed page size to be settable by setting

just one parameter: UNIV_PAGE_SIZE_SHIFT.

UNIV_PAGE_SIZE, BUF_BUDDY_SIZES: Define in terms of UNIV_PAGE_SIZE_SHIFT.

BUF_BUDDY_LOW_SHIFT: New macro, to simplify the definition of BUF_BUDDY_LOW
and BUF_BUDDY_SIZES.

PAGE_ZIP_DIR_SLOT_MASK: Relax the compile-time check.  This bitmask must be
one less than a power of two, and at least UNIV_PAGE_SIZE - 1.
parent 8c852371
......@@ -34,14 +34,16 @@ enum buf_io_fix {
/* Parameters of binary buddy system for compressed pages (buf0buddy.h) */
#if UNIV_WORD_SIZE <= 4 /* 32-bit system */
# define BUF_BUDDY_LOW 64 /* minimum block size in the binary
buddy system; must be at least
sizeof(buf_page_t) */
# define BUF_BUDDY_SIZES 8 /* number of buddy sizes */
# define BUF_BUDDY_LOW_SHIFT 6
#else /* 64-bit system */
# define BUF_BUDDY_LOW 128 /* sizeof(buf_page_t) > 64 */
# define BUF_BUDDY_SIZES 7
# define BUF_BUDDY_LOW_SHIFT 7
#endif
#define BUF_BUDDY_LOW (1 << BUF_BUDDY_LOW_SHIFT)
/* minimum block size in the binary
buddy system; must be at least
sizeof(buf_page_t) */
#define BUF_BUDDY_SIZES (UNIV_PAGE_SIZE_SHIFT - BUF_BUDDY_LOW_SHIFT)
/* number of buddy sizes */
/* twice the maximum block size of the buddy system;
the underlying memory is aligned by this amount:
......
......@@ -208,11 +208,10 @@ management to ensure correct alignment for doubles etc. */
========================
*/
/* The universal page size of the database */
#define UNIV_PAGE_SIZE (2 * 8192) /* NOTE! Currently, this has to be a
power of 2 */
/* The 2-logarithm of UNIV_PAGE_SIZE: */
#define UNIV_PAGE_SIZE_SHIFT 14
/* The universal page size of the database */
#define UNIV_PAGE_SIZE (1 << UNIV_PAGE_SIZE_SHIFT)
/* Maximum number of parallel threads in a parallelized operation */
#define UNIV_MAX_PARALLELISM 32
......
......@@ -556,8 +556,11 @@ page_zip_dir_encode(
ut_a(heap_no < n_heap);
ut_a(offs < UNIV_PAGE_SIZE - PAGE_DIR);
ut_a(offs >= PAGE_ZIP_START);
#if PAGE_ZIP_DIR_SLOT_MASK & UNIV_PAGE_SIZE
# error "PAGE_ZIP_DIR_SLOT_MASK & UNIV_PAGE_SIZE"
#if PAGE_ZIP_DIR_SLOT_MASK & (PAGE_ZIP_DIR_SLOT_MASK + 1)
# error "PAGE_ZIP_DIR_SLOT_MASK is not 1 less than a power of 2"
#endif
#if PAGE_ZIP_DIR_SLOT_MASK < UNIV_PAGE_SIZE - 1
# error "PAGE_ZIP_DIR_SLOT_MASK < UNIV_PAGE_SIZE - 1"
#endif
if (UNIV_UNLIKELY(rec_get_n_owned_new(rec))) {
offs |= PAGE_ZIP_DIR_SLOT_OWNED;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment