diff --git a/CMakeLists.txt b/CMakeLists.txt index 6706779a91d84..6e829bd518a7e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -193,6 +193,10 @@ ELSE() SET (SKIP_COMPONENTS "N-O-N-E") ENDIF() +SET(IO_SIZE "" CACHE STRING "Specify the I/O buffer size") +IF(IO_SIZE) + ADD_DEFINITIONS(-DIO_SIZE=${IO_SIZE}) +ENDIF() SET(MEMPROTECT_DEFAULT ON) diff --git a/include/my_global.h b/include/my_global.h index 76ec2f813083e..5b349904fbfc5 100644 --- a/include/my_global.h +++ b/include/my_global.h @@ -676,7 +676,9 @@ typedef SOCKET_SIZE_TYPE size_socket; This influences the speed of the isam btree library. E.g.: too big too slow. 4096 is a common block size on SSDs. */ +#ifndef IO_SIZE #define IO_SIZE 4096U +#endif #if ((IO_SIZE <= 0) || ((IO_SIZE % 512) != 0) || ((IO_SIZE & (IO_SIZE-1)) != 0)) #error "IO_SIZE must be a positive multiple of 512 and power of 2" #endif