Wireshark 4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
Macros | Typedefs

Macros

#define wmem_queue_count(X)   wmem_list_count(X)
 Get the number of elements in a wmem queue.
 
#define wmem_queue_peek(QUEUE)   wmem_stack_peek(QUEUE)
 Peek at the front element of a wmem queue without removing it.
 
#define wmem_queue_pop(QUEUE)   wmem_stack_pop(QUEUE)
 Remove and return the front element of a wmem queue.
 
#define wmem_queue_push(QUEUE, DATA)   wmem_list_append((QUEUE), (DATA))
 Add a data element to the end of a wmem queue.
 
#define wmem_queue_new(ALLOCATOR)   wmem_list_new(ALLOCATOR)
 Create a new wmem queue using the specified memory allocator.
 
#define wmem_destroy_queue(QUEUE)   wmem_destroy_list(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)    wmem_destroy_list(QUEUE)

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)    wmem_list_count(X)

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)    wmem_list_new(ALLOCATOR)

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)    wmem_stack_peek(QUEUE)

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)    wmem_stack_pop(QUEUE)

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 
)    wmem_list_append((QUEUE), (DATA))

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.