Skip to content
/ server Public

Commit 16967b9

Browse files
committed
Convert comment to compile-time check, fix grammar
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]>
1 parent ae998c2 commit 16967b9

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

include/my_global.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -672,12 +672,15 @@ typedef SOCKET_SIZE_TYPE size_socket;
672672
#endif
673673

674674
/*
675-
Io buffer size; Must be a power of 2 and a multiple of 512. May be
676-
smaller what the disk page size. This influences the speed of the
677-
isam btree library. eg to big to slow.
675+
I/O buffer size. May be smaller than the disk page size.
676+
This influences the speed of the isam btree library. E.g.: too big too slow.
678677
4096 is a common block size on SSDs.
679678
*/
680679
#define IO_SIZE 4096U
680+
#if ((IO_SIZE <= 0) || ((IO_SIZE % 512) != 0) || ((IO_SIZE & (IO_SIZE-1)) != 0))
681+
#error "IO_SIZE must be a positive multiple of 512 and power of 2"
682+
#endif
683+
681684
/*
682685
How much overhead does malloc have. The code often allocates
683686
something like 1024-MALLOC_OVERHEAD bytes

0 commit comments

Comments
 (0)