![]() |
The FreeRADIUS server $Id: a4e7f8c94e8038b7627bcf52356b7ed15955c1d7 $
|
#include <freeradius-devel/io/atomic_queue.h>#include <freeradius-devel/util/debug.h>#include <freeradius-devel/util/table.h>#include <freeradius-devel/util/strerror.h>#include <string.h>#include <sys/time.h>
Include dependency graph for atomic_queue_test.c:Go to the source code of this file.
Macros | |
| #define | OFFSET (1024) |
Typedefs | |
| typedef void(* | queue_test_t) (TALLOC_CTX *ctx, int size) |
| typedef struct request_s | request_t |
Enumerations | |
| enum | queue_type_t : uint8_t { QUEUE_TYPE_TALLOC = 0 , QUEUE_TYPE_MALLOC , QUEUE_TYPE_MMAP , QUEUE_TYPE_MAX } |
| Which allocator the queue under test comes from. More... | |
Functions | |
| int | main (int argc, char *argv[]) |
| static void | queue_exercise (fr_atomic_queue_t *aq, int size) |
| Fill and drain with the many-producer functions, then the single-producer ones. | |
| static void | queue_exercise_flavour (fr_atomic_queue_t *aq, int size, bool(*push)(fr_atomic_queue_t *, void const *), bool(*pop)(fr_atomic_queue_t *, void *)) |
| Fill the queue to capacity, check it refuses one more, then drain it. | |
| void | request_verify (UNUSED char const *file, UNUSED int line, UNUSED request_t *request) |
| static void | test_malloc (TALLOC_CTX *ctx, int size) |
| Queue allocated outside talloc, but owned by a talloc context. | |
| static void | test_mmap (TALLOC_CTX *ctx, int size) |
| Queue in a shared memory mapping, owned by a talloc handle. | |
| static void | test_talloc (TALLOC_CTX *ctx, int size) |
| Queue allocated inside the talloc hierarchy. | |
| static NEVER_RETURNS void | usage (void) |
Variables | |
| static int | debug_lvl = 0 |
| static queue_test_t const | queue_tests [QUEUE_TYPE_MAX] |
| static fr_table_num_sorted_t const | queue_type_table [] |
| static size_t | queue_type_table_len = NUM_ELEMENTS(queue_type_table) |
| #define OFFSET (1024) |
Definition at line 36 of file atomic_queue_test.c.
| typedef void(* queue_test_t) (TALLOC_CTX *ctx, int size) |
Definition at line 318 of file atomic_queue_test.c.
Definition at line 58 of file atomic_queue_test.c.
| enum queue_type_t : uint8_t |
Which allocator the queue under test comes from.
| Enumerator | |
|---|---|
| QUEUE_TYPE_TALLOC | fr_atomic_queue_talloc, queue lives in the talloc hierarchy. |
| QUEUE_TYPE_MALLOC | fr_atomic_queue_malloc, raw queue owned by a talloc handle. |
| QUEUE_TYPE_MMAP | fr_atomic_queue_mmap, shared memory queue owned by a talloc handle. |
| QUEUE_TYPE_MAX | |
Definition at line 42 of file atomic_queue_test.c.
| int main | ( | int | argc, |
| char * | argv[] | ||
| ) |
|
static |
Fill and drain with the many-producer functions, then the single-producer ones.
Definition at line 179 of file atomic_queue_test.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Fill the queue to capacity, check it refuses one more, then drain it.
Exits the process on the first wrong answer.
Definition at line 81 of file atomic_queue_test.c.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Queue allocated outside talloc, but owned by a talloc context.
The only talloc'd block is the owner handle, so the context holds exactly one child, and freeing the context releases the raw queue through the handle.
Definition at line 207 of file atomic_queue_test.c.
Here is the call graph for this function:
|
static |
Queue in a shared memory mapping, owned by a talloc handle.
As test_malloc for the creator. Then a second queue is attached to the creator's descriptor, as another process would, and elements pushed through one are popped from the other.
Definition at line 235 of file atomic_queue_test.c.
Here is the call graph for this function:
|
static |
Queue allocated inside the talloc hierarchy.
Definition at line 187 of file atomic_queue_test.c.
Here is the call graph for this function:
|
static |
|
static |
Definition at line 38 of file atomic_queue_test.c.
|
static |
Definition at line 320 of file atomic_queue_test.c.
|
static |
Definition at line 49 of file atomic_queue_test.c.
|
static |
Definition at line 54 of file atomic_queue_test.c.
1.9.8