Debian Codegraph @

unittest/gunit/innodb/lob/lot0types.h

raw symbols SCIP
1 /*****************************************************************************
2
3 Copyright (c) 2016, 2026, Oracle and/or its affiliates.
4
5 This program is free software; you can redistribute it and/or modify it under
6 the terms of the GNU General Public License, version 2.0, as published by the
7 Free Software Foundation.
8
9 This program is designed to work with certain software (including
10 but not limited to OpenSSL) that is licensed under separate terms,
11 as designated in a particular file or component or in included license
12 documentation. The authors of MySQL hereby grant you an additional
13 permission to link the program and your derivative works with the
14 separately licensed software that they have either included with
15 the program or referenced in the documentation.
16
17 This program is distributed in the hope that it will be useful, but WITHOUT
18 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
19 FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0,
20 for more details.
21
22 You should have received a copy of the GNU General Public License along with
23 this program; if not, write to the Free Software Foundation, Inc.,
24 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25
26 *****************************************************************************/
27 #ifndef _lot0types_h_
28 #define _lot0types_h_
29
30 #include <stdint.h>
31 #include <cassert>
32 #include <iostream>
33 #include <limits>
34
35 #ifdef _WIN64
36 using ulint = unsigned __int64;
37 using lobid_t = unsigned __int64;
38 #else
39 using ulint = unsigned long int;
40 using lobid_t = unsigned long int;
41 #endif
42 using byte = unsigned char;
43 using frag_id_t = ulint;
44 typedef uint32_t space_id_t;
45 typedef uint64_t ib_uint64_t;
46 typedef ib_uint64_t ib_id_t;
47 using page_no_t = uint32_t;
48 typedef byte page_t;
49 typedef ib_id_t trx_id_t;
50
51 const ulint FRAG_ID_NULL = std::numeric_limits<uint16_t>::max();
52 const ulint KB1 = 1024;
53 const ulint KB2 = 2 * 1024;
54 const ulint KB5 = 5 * 1024;
55 const ulint KB16 = 16 * 1024;
56 const ulint KB64 = 64 * 1024;
57 const ulint KB128 = 128 * 1024;
58 const ulint KB300 = 300 * 1024;
59 const ulint KB500 = 500 * 1024;
60 const ulint MB16 = 16 * 1024 * 1024;
61 const ulint MB10 = 10 * 1024 * 1024;
62 const ulint MB1 = 1024 * 1024;
63 const ulint MB2 = 2 * MB1;
64 const ulint MB3 = 3 * MB1;
65 const ulint MB4 = 2 * MB2;
66 const ulint MB5 = 5 * 1024 * 1024;
67 const ulint MB7 = 7 * 1024 * 1024;
68 const ulint MB100 = 100 * 1024 * 1024;
69 const ulint GB1 = 1024 * 1024 * 1024 * 1UL;
70 const uint64_t GB4 = 1024 * 1024 * 1024 * 4UL;
71 const ulint FIL_PAGE_DATA = 38U;
72 const unsigned int UNIV_PAGE_SIZE = 16384; /* 16KB */
73 constexpr page_no_t FIL_NULL = std::numeric_limits<page_no_t>::max();
74
75 /** page offset inside space */
76 #define FIL_PAGE_OFFSET 4
77
78 /** The next page information stored in 4 bytes. */
79 #define FIL_PAGE_NEXT 12
80 #define FIL_PAGE_TYPE 24
81
82 /** start of the data on the page */
83 #define FIL_PAGE_DATA 38U
84
85 /** The bitmask of 32-bit unsigned integer */
86 #define ULINT32_MASK 0xFFFFFFFF
87
88 #define FIL_ADDR_SIZE 6 /* address size is 6 bytes */
89
90 /* The physical size of a list base node in bytes */
91 #define FLST_BASE_NODE_SIZE (4 + 2 * FIL_ADDR_SIZE)
92
93 /* The physical size of a list node in bytes */
94 #define FLST_NODE_SIZE (2 * FIL_ADDR_SIZE)
95
96 #endif // _lot0types_h_