Mstdlib-1.24.0

Functions

M_io_error_t M_io_add_buffer (M_io_t *io, size_t *layer_id, size_t max_read_buffer, size_t max_write_buffer)
 

Detailed Description

Intermediate layer for buffering reads/writes from the OS.

Allows data to be buffered, this can reduce the number of syscalls required to the OS and increase performance at the cost of memory.

Function Documentation

◆ M_io_add_buffer()

M_io_error_t M_io_add_buffer ( M_io_t io,
size_t *  layer_id,
size_t  max_read_buffer,
size_t  max_write_buffer 
)

Add a buffer layer. Cannot be combined with base IO objects which utilize M_io_meta_t.

Parameters
[in]ioio object.
[out]layer_idLayer id this is added at.
[in]max_read_bufferMaximum read buffer size in bytes. If not a power of 2 will be rounded up to the next power of 2. Use 0 to disable read buffering.
[in]max_write_bufferMaximum write buffer size in bytes. If not a power of 2 will be rounded up to the next power of 2. Use 0 to disable write buffering.
Returns
Result.