Blender V4.3
BLI_gsqueue.h File Reference
#include "BLI_utildefines.h"

Go to the source code of this file.

Typedefs

typedef struct _GSQueue GSQueue
 

Functions

GSQueueBLI_gsqueue_new (size_t elem_size)
 
bool BLI_gsqueue_is_empty (const GSQueue *queue)
 
size_t BLI_gsqueue_len (const GSQueue *queue)
 
void BLI_gsqueue_pop (GSQueue *queue, void *r_item)
 
void BLI_gsqueue_push (GSQueue *queue, const void *item)
 
void BLI_gsqueue_free (GSQueue *queue)
 

Typedef Documentation

◆ GSQueue

typedef struct _GSQueue GSQueue

Definition at line 17 of file BLI_gsqueue.h.

Function Documentation

◆ BLI_gsqueue_free()

void BLI_gsqueue_free ( GSQueue * queue)

Free the queue's data and the queue itself.

Definition at line 93 of file gsqueue.c.

References MEM_freeN(), and queue_free_chunk().

Referenced by BLI_thread_queue_free(), unsubdivide_face_center_vertex_tag(), unsubdivide_init_elem_ids(), and unsubdivide_tag_disconnected_mesh_element().

◆ BLI_gsqueue_is_empty()

bool BLI_gsqueue_is_empty ( const GSQueue * queue)

◆ BLI_gsqueue_len()

size_t BLI_gsqueue_len ( const GSQueue * queue)

Definition at line 157 of file gsqueue.c.

Referenced by BLI_thread_queue_len().

◆ BLI_gsqueue_new()

◆ BLI_gsqueue_pop()

void BLI_gsqueue_pop ( GSQueue * queue,
void * r_item )

Retrieves and removes the first element from the queue. The value is copies to r_item, which must be at least elem_size bytes.

Does not reduce amount of allocated memory.

Definition at line 134 of file gsqueue.c.

References BLI_assert, BLI_gsqueue_is_empty(), QueueChunk::next, NULL, queue_get_first_elem(), and UNLIKELY.

Referenced by BLI_thread_queue_pop(), BLI_thread_queue_pop_timeout(), unsubdivide_face_center_vertex_tag(), unsubdivide_init_elem_ids(), and unsubdivide_tag_disconnected_mesh_element().

◆ BLI_gsqueue_push()

void BLI_gsqueue_push ( GSQueue * queue,
const void * item )

Copies the source value onto the end of the queue

Note
This copies GSQueue.elem_size bytes from item, (the pointer itself is not stored).
Parameters
itemsource data to be copied to the queue.

Definition at line 100 of file gsqueue.c.

References BLI_assert, MEM_mallocN, QueueChunk::next, NULL, queue_get_last_elem(), and UNLIKELY.

Referenced by BLI_thread_queue_push(), unsubdivide_face_center_vertex_tag(), unsubdivide_init_elem_ids(), and unsubdivide_tag_disconnected_mesh_element().