Skip to content

Commit

Permalink
Convert comment to compile-time check, fix grammar
Browse files Browse the repository at this point in the history
By converting the text describing the constraints of the constant
to a compile-time check, this enables us to make IO_SIZE configurable.

It should be noted that this #define is duplicated in the submodule
libmariadb in the include/ma_global.h file.

Signed-off-by: Eric Herman <[email protected]>
  • Loading branch information
ericherman committed Dec 31, 2024
1 parent ae998c2 commit 16967b9
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions include/my_global.h
Original file line number Diff line number Diff line change
Expand Up @@ -672,12 +672,15 @@ typedef SOCKET_SIZE_TYPE size_socket;
#endif

/*
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 4096U
#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

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

0 comments on commit 16967b9

Please sign in to comment.