aura
0.1
|
Data Structures | |
struct | aura_buffer |
Functions | |
struct aura_buffer * | aura_buffer_request (struct aura_node *nd, int size) |
void | aura_buffer_release (struct aura_buffer *buf) |
void | aura_buffer_destroy (struct aura_buffer *buf) |
void | aura_bufferpool_gc (struct aura_node *nd, int numdrop, int threshold) |
void | aura_bufferpool_preheat (struct aura_node *nd, int size, int count) |
void | aura_bufferpool_set_gc_threshold (struct aura_node *nd, int threshold) |
static void | aura_buffer_rewind (struct aura_buffer *buf) |
All arguments, event data and returned values are stored in buffers, represented by struct aura_buffer The actual data is stored in NODE endianness (e.g. the same byte order that is on the remote side) Transport plugins can override buffer management, if required.
If you are just using aura for your application - treat aura_buffer as an opaque type. You won't really need this API in most cases.
If you are developing a transport plugin - you may need some of these calls, but most likely you'll need to manipululate buffer->data[] directly.
Try to adjust your transport's buffer_overhead and buffer_offset parameters so that you will not need any temporary buffers.
void aura_buffer_destroy | ( | struct aura_buffer * | buf | ) |
Force aura to immediately free the buffer, bypassing the node's buffer pool. Do not call this function directly, unless you know what you are doing - use aura_buffer_release() instead.
buf |
Definition at line 101 of file buffer.c.
References aura_buffer::magic, and aura_buffer::owner.
Referenced by aura_buffer_release(), aura_bufferpool_gc(), and aura_handle_events_timeout().
void aura_buffer_release | ( | struct aura_buffer * | buf | ) |
Release an aura_buffer, returning it back to the node's buffer pool. Aura call with garbage-collect the buffer pool later
nd | |
buf |
Definition at line 80 of file buffer.c.
References aura_buffer_destroy(), aura_buffer::magic, aura_buffer::owner, and aura_buffer::qentry.
Referenced by aura_bufferpool_preheat(), aura_enable_sync_events(), aura_start_call(), and aura_start_call_raw().
struct aura_buffer* aura_buffer_request | ( | struct aura_node * | nd, |
int | size | ||
) |
Request an buffer for this node big enough to contain at least size bytes of data. The data is returned in struct aura_buffer
If the node transport overrides buffer allocation - transport-specific allocation function will be called
nd | |
size |
Definition at line 40 of file buffer.c.
References aura_buffer_rewind(), aura_buffer::data, aura_buffer::magic, aura_buffer::owner, and aura_buffer::size.
Referenced by aura_bufferpool_preheat().
|
inlinestatic |
Reposition the internal pointer of the buffer buf to the start of serialized data. This function takes buffer_offset of the node's transport into account
node | |
buf |
Definition at line 93 of file inlines.h.
References aura_buffer::owner, and aura_buffer::pos.
Referenced by aura_buffer_request(), aura_dequeue_buffer(), and aura_queue_buffer().
void aura_bufferpool_gc | ( | struct aura_node * | nd, |
int | numdrop, | ||
int | threshold | ||
) |
Garbage-collect at most numdrop buffers from the buffer pool, if the total number of buffers in the pool is greater than threshold.
threshold == 0 and numdrop == -1 drop everything from the pool.
nd | |
numdrop | - maximum number of buffers to destroy during this iteration |
threshold | - maximum number of buffers to keep in the pool |
Definition at line 124 of file buffer.c.
References aura_buffer_destroy(), aura_buffer::pos, and aura_buffer::qentry.
void aura_bufferpool_preheat | ( | struct aura_node * | nd, |
int | size, | ||
int | count | ||
) |
Force-populate the bufferpool with count buffers of size size Warning: If count exceeds the threshold they will start being dropped by the GC.
Definition at line 147 of file buffer.c.
References aura_buffer_release(), and aura_buffer_request().
void aura_bufferpool_set_gc_threshold | ( | struct aura_node * | nd, |
int | threshold | ||
) |
Manually override buffer pool gc threshold. The automatic gc will start releasing buffers, one per loop once the are more than threshold buffers in the free buffer pool
nd | The node for which we're setting the new threshold |
threshold | The new threshold |