Wireshark 4.7.2
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches

Macros

#define wmem_queue_count(X)
 Get the number of elements in a wmem queue.
#define wmem_queue_peek(QUEUE)
 Peek at the front element of a wmem queue without removing it.
#define wmem_queue_pop(QUEUE)
 Remove and return the front element of a wmem queue.
#define wmem_queue_push(QUEUE, DATA)
 Add a data element to the end of a wmem queue.
#define wmem_queue_new(ALLOCATOR)
 Create a new wmem queue using the specified memory allocator.
#define wmem_destroy_queue(QUEUE)
 Destroy a wmem queue and release its internal resources.

Typedefs

typedef wmem_list_t wmem_queue_t
 A queue abstraction implemented as a wrapper over wmem_list_t.

Detailed Description

A queue implementation on top of wmem.

Macro Definition Documentation

◆ wmem_destroy_queue

#define wmem_destroy_queue ( QUEUE)
Value:
void wmem_destroy_list(wmem_list_t *list)
Destroy a wmem list and release its internal resources.
Definition wmem_list.c:291

Destroy a wmem queue and release its internal resources.

Frees all internal memory associated with the given wmem_queue_t, including its frames. This macro maps directly to wmem_destroy_list(QUEUE).

Note
This does not free the data stored in the queue frames.
Parameters
QUEUEPointer to the queue to destroy.

◆ wmem_queue_count

#define wmem_queue_count ( X)
Value:
unsigned wmem_list_count(const wmem_list_t *list)
Count the number of elements in a wmem list.
Definition wmem_list.c:30

Get the number of elements in a wmem queue.

Returns the number of frames currently stored in the queue. This macro maps directly to wmem_list_count(X).

Parameters
XPointer to a wmem_queue_t.
Returns
Number of elements in the queue.

◆ wmem_queue_new

#define wmem_queue_new ( ALLOCATOR)
Value:
wmem_list_new(ALLOCATOR)
wmem_list_t * wmem_list_new(wmem_allocator_t *allocator)
Create a new wmem list using the specified memory allocator.
Definition wmem_list.c:276

Create a new wmem queue using the specified memory allocator.

Allocates and initializes a new wmem_queue_t, implemented as a wrapper over wmem_list_t. This macro maps directly to wmem_list_new(ALLOCATOR).

Parameters
ALLOCATORPointer to a wmem_allocator_t used for memory management.
Returns
Pointer to the newly created wmem_queue_t.

◆ wmem_queue_peek

#define wmem_queue_peek ( QUEUE)
Value:
void * wmem_stack_peek(const wmem_stack_t *stack)
Peek at the top element of a wmem stack without removing it.
Definition wmem_stack.c:23

Peek at the front element of a wmem queue without removing it.

Returns the data pointer stored in the front frame of the queue. This macro maps directly to wmem_stack_peek(QUEUE).

Parameters
QUEUEPointer to the wmem_queue_t to inspect.
Returns
Pointer to the data at the front of the queue, or NULL if empty.

◆ wmem_queue_pop

#define wmem_queue_pop ( QUEUE)
Value:
void * wmem_stack_pop(wmem_stack_t *stack)
Pop the top element from a wmem stack.
Definition wmem_stack.c:35

Remove and return the front element of a wmem queue.

Removes the front frame from the queue and returns its data pointer. This macro maps directly to wmem_stack_pop(QUEUE).

Parameters
QUEUEPointer to the wmem_queue_t to modify.
Returns
Pointer to the data that was at the front, or NULL if empty.

◆ wmem_queue_push

#define wmem_queue_push ( QUEUE,
DATA )
Value:
wmem_list_append((QUEUE), (DATA))
void wmem_list_append(wmem_list_t *list, void *data)
Appends a data element to the end of a wmem list.
Definition wmem_list.c:154

Add a data element to the end of a wmem queue.

Appends the specified DATA pointer to the tail of the queue. This macro maps directly to wmem_list_append((QUEUE), (DATA)).

Parameters
QUEUEPointer to the wmem_queue_t to modify.
DATAPointer to the data to enqueue.

Typedef Documentation

◆ wmem_queue_t

A queue abstraction implemented as a wrapper over wmem_list_t.

The wmem queue provides FIFO (first-in, first-out) semantics using the underlying doubly-linked list structure (wmem_list_t). All queue operations are built on top of list and stack functions for simplicity and consistency.