Blender
V3.3
|
A generic structure queue (a queue for fixed length generally small) structures. More...
#include <string.h>
#include "MEM_guardedalloc.h"
#include "BLI_gsqueue.h"
#include "BLI_strict_flags.h"
#include "BLI_utildefines.h"
Go to the source code of this file.
Classes | |
struct | QueueChunk |
struct | _GSQueue |
Macros | |
#define | CHUNK_SIZE_DEFAULT (1 << 16) |
#define | CHUNK_ELEM_MIN 32 |
Functions | |
static void * | queue_get_first_elem (GSQueue *queue) |
static void * | queue_get_last_elem (GSQueue *queue) |
static size_t | queue_chunk_elem_max_calc (const size_t elem_size, size_t chunk_size) |
GSQueue * | BLI_gsqueue_new (const size_t elem_size) |
static void | queue_free_chunk (struct QueueChunk *data) |
void | BLI_gsqueue_free (GSQueue *queue) |
void | BLI_gsqueue_push (GSQueue *queue, const void *item) |
void | BLI_gsqueue_pop (GSQueue *queue, void *r_item) |
size_t | BLI_gsqueue_len (const GSQueue *queue) |
bool | BLI_gsqueue_is_empty (const GSQueue *queue) |
A generic structure queue (a queue for fixed length generally small) structures.
Definition in file gsqueue.c.
Free the queue's data and the queue itself.
Definition at line 90 of file gsqueue.c.
References MEM_freeN, queue, and queue_free_chunk().
Referenced by BLI_thread_queue_free(), sculpt_boundary_edit_data_init(), sculpt_expand_boundary_topology_falloff_create(), sculpt_expand_diagonals_falloff_create(), sculpt_face_sets_init_flood_fill(), SCULPT_floodfill_free(), SCULPT_geometry_preview_lines_update(), unsubdivide_face_center_vertex_tag(), unsubdivide_init_elem_ids(), and unsubdivide_tag_disconnected_mesh_element().
Returns true if the queue is empty, false otherwise.
Definition at line 159 of file gsqueue.c.
Referenced by BLI_gsqueue_pop(), BLI_thread_queue_is_empty(), BLI_thread_queue_pop(), BLI_thread_queue_pop_timeout(), BLI_thread_queue_wait_finish(), sculpt_boundary_edit_data_init(), sculpt_expand_boundary_topology_falloff_create(), sculpt_expand_diagonals_falloff_create(), sculpt_face_sets_init_flood_fill(), SCULPT_floodfill_execute(), SCULPT_geometry_preview_lines_update(), unsubdivide_face_center_vertex_tag(), unsubdivide_init_elem_ids(), and unsubdivide_tag_disconnected_mesh_element().
size_t BLI_gsqueue_len | ( | const GSQueue * | queue | ) |
GSQueue* BLI_gsqueue_new | ( | const size_t | elem_size | ) |
Definition at line 69 of file gsqueue.c.
References CHUNK_SIZE_DEFAULT, MEM_callocN, queue, and queue_chunk_elem_max_calc().
Referenced by BLI_thread_queue_init(), sculpt_boundary_edit_data_init(), sculpt_expand_boundary_topology_falloff_create(), sculpt_expand_diagonals_falloff_create(), sculpt_face_sets_init_flood_fill(), SCULPT_floodfill_init(), SCULPT_geometry_preview_lines_update(), unsubdivide_face_center_vertex_tag(), unsubdivide_init_elem_ids(), and unsubdivide_tag_disconnected_mesh_element().
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 131 of file gsqueue.c.
References BLI_assert, BLI_gsqueue_is_empty(), QueueChunk::next, NULL, queue, queue_get_first_elem(), and UNLIKELY.
Referenced by BLI_thread_queue_pop(), BLI_thread_queue_pop_timeout(), sculpt_boundary_edit_data_init(), sculpt_expand_boundary_topology_falloff_create(), sculpt_expand_diagonals_falloff_create(), sculpt_face_sets_init_flood_fill(), SCULPT_floodfill_execute(), SCULPT_geometry_preview_lines_update(), unsubdivide_face_center_vertex_tag(), unsubdivide_init_elem_ids(), and unsubdivide_tag_disconnected_mesh_element().
Copies the source value onto the end of the queue
item | source data to be copied to the queue. |
Definition at line 97 of file gsqueue.c.
References BLI_assert, MEM_mallocN, QueueChunk::next, NULL, queue, queue_get_last_elem(), and UNLIKELY.
Referenced by BLI_thread_queue_push(), sculpt_boundary_edit_data_init(), sculpt_expand_boundary_topology_falloff_create(), sculpt_expand_diagonals_falloff_create(), sculpt_face_sets_init_flood_fill(), SCULPT_floodfill_add_and_skip_initial(), SCULPT_floodfill_add_initial(), SCULPT_floodfill_execute(), SCULPT_geometry_preview_lines_update(), unsubdivide_face_center_vertex_tag(), unsubdivide_init_elem_ids(), and unsubdivide_tag_disconnected_mesh_element().
|
static |
Definition at line 52 of file gsqueue.c.
References BLI_assert, CHUNK_ELEM_MIN, blender::io::obj::chunk_size, MEM_SIZE_OVERHEAD, and UNLIKELY.
Referenced by BLI_gsqueue_new().
|
static |
Definition at line 81 of file gsqueue.c.
References data, and MEM_freeN.
Referenced by BLI_gsqueue_free().