srv0start.c, univ.i, configure.in:

  Check at compilation time on Unix that InnoDB ulint is the same size as void*, and also check it at runtime
parent 528c3310
......@@ -37,6 +37,7 @@ AC_PROG_INSTALL
AC_CHECK_HEADERS(aio.h sched.h)
AC_CHECK_SIZEOF(int, 4)
AC_CHECK_SIZEOF(long, 4)
AC_CHECK_SIZEOF(void*, 4)
AC_CHECK_FUNCS(sched_yield)
AC_CHECK_FUNCS(fdatasync)
#AC_CHECK_FUNCS(localtime_r) # Already checked by MySQL
......
......@@ -204,6 +204,12 @@ typedef __int64 ib_longlong;
typedef longlong ib_longlong;
#endif
#ifndef __WIN__
#if SIZEOF_LONG != SIZEOF_VOIDP
#error "Error: InnoDB's ulint must be of the same size as void*"
#endif
#endif
/* The following type should be at least a 64-bit floating point number */
typedef double utfloat;
......
......@@ -57,7 +57,6 @@ Created 2/16/1996 Heikki Tuuri
#include "srv0start.h"
#include "que0que.h"
/* Log sequence number immediately after startup */
dulint srv_start_lsn;
/* Log sequence number at shutdown */
......@@ -1010,6 +1009,14 @@ innobase_start_or_create_for_mysql(void)
ibool srv_file_per_table_original_value = srv_file_per_table;
mtr_t mtr;
if (sizeof(ulint) != sizeof(void*)) {
fprintf(stderr,
"InnoDB: Error: size of InnoDB's ulint is %lu, but size of void* is %lu.\n"
"InnoDB: The sizes should be the same so that on a 64-bit platform you can\n"
"InnoDB: allocate more than 4 GB of memory.",
(ulong)sizeof(ulint), (ulong)sizeof(void*));
}
srv_file_per_table = FALSE; /* system tables are created in tablespace
0 */
#ifdef UNIV_DEBUG
......
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