evbuffer_reserve_space

Reserves space in the last chain or chains of an evbuffer.

Makes space available in the last chain or chains of an evbuffer that can be arbitrarily written to by a user. The space does not become available for reading until it has been committed with evbuffer_commit_space().

The space is made available as one or more extents, represented by an initial pointer and a length. You can force the memory to be available as only one extent. Allowing more extents, however, makes the function more efficient.

Multiple subsequent calls to this function will make the same space available until evbuffer_commit_space() has been called.

It is an error to do anything that moves around the buffer's internal memory structures before committing the space.

NOTE: The code currently does not ever use more than two extents. This may change in future versions.

@param buf the evbuffer in which to reserve space. @param size how much space to make available, at minimum. The total length of the extents may be greater than the requested length. @param vec an array of one or more evbuffer_iovec structures to hold pointers to the reserved extents of memory. @param n_vec The length of the vec array. Must be at least 1; 2 is more efficient. @return the number of provided extents, or -1 on error. @see evbuffer_commit_space()

extern (C) nothrow
int
evbuffer_reserve_space

Meta