Skip to content

Commit

Permalink
Avoid redfine of IO_SIZE if made configurable
Browse files Browse the repository at this point in the history
If the server is to make IO_SIZE configurable, we need to avoid either
redefining it, or defining it to be different.

See: MariaDB/server#3726

Signed-off-by: Eric Herman <[email protected]>
  • Loading branch information
ericherman committed Jan 3, 2025
1 parent 1059275 commit 8079810
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions include/ma_global.h
Original file line number Diff line number Diff line change
Expand Up @@ -433,11 +433,17 @@ typedef SOCKET_SIZE_TYPE size_socket;
/* #define FN_UPPER_CASE TRUE */

/*
Io buffer size; Must be a power of 2 and a multiple of 512. May be
smaller what the disk page size. This influences the speed of the
isam btree library. eg to big to slow.
I/O buffer size. May be smaller than the disk page size.
This influences the speed of the isam btree library. E.g.: too big too slow.
4096 is a common block size on SSDs.
*/
#define IO_SIZE 4096
#ifndef IO_SIZE
#define IO_SIZE 4096U
#endif
#if (IO_SIZE < 512) || (IO_SIZE & (IO_SIZE-1))
#error "IO_SIZE must be a positive multiple of 512 and power of 2"
#endif

/*
How much overhead does malloc have. The code often allocates
something like 1024-MALLOC_OVERHEAD bytes
Expand Down

0 comments on commit 8079810

Please sign in to comment.