3 #include "testing/testing.h"
35 static const int nodes_num = 128;
51 if (node_index != nodes_num - 1) {
66 void concurrent_insert(
TaskPool *__restrict
pool,
void *taskdata)
70 IndexedNode *
node = (IndexedNode *)
MEM_mallocN(
sizeof(IndexedNode),
"test node");
79 static const int nodes_num = 655360;
86 for (
int i = 0; i < nodes_num; ++i) {
93 bool *visited_nodes = (
bool *)
MEM_callocN(
sizeof(
bool) * nodes_num,
"visited nodes");
96 node_v = node_v->
next) {
97 IndexedNode *
node = (IndexedNode *)node_v;
98 EXPECT_GE(
node->index, 0);
99 EXPECT_LT(
node->index, nodes_num);
100 EXPECT_FALSE(visited_nodes[
node->index]);
101 visited_nodes[
node->index] =
true;
104 for (
int node_index = 0; node_index < nodes_num; ++node_index) {
105 EXPECT_TRUE(visited_nodes[node_index]);
EXPECT_EQ(BLI_expr_pylike_eval(expr, nullptr, 0, &result), EXPR_PYLIKE_INVALID)
void BLI_linklist_lockfree_free(LockfreeLinkList *list, LockfreeeLinkNodeFreeFP free_func)
void BLI_linklist_lockfree_insert(LockfreeLinkList *list, LockfreeLinkNode *node)
void BLI_linklist_lockfree_init(LockfreeLinkList *list)
LockfreeLinkNode * BLI_linklist_lockfree_begin(LockfreeLinkList *list)
TEST(LockfreeLinkList, Init)
void * BLI_task_pool_user_data(TaskPool *pool)
void BLI_task_pool_work_and_wait(TaskPool *pool)
TaskPool * BLI_task_pool_create_suspended(void *userdata, eTaskPriority priority)
void BLI_task_pool_free(TaskPool *pool)
void BLI_task_pool_push(TaskPool *pool, TaskRunFunction run, void *taskdata, bool free_taskdata, TaskFreeFunction freedata)
#define POINTER_FROM_INT(i)
#define POINTER_AS_INT(i)
Read Guarded memory(de)allocation.
#define CHECK_NOTNULL(expression)
void(* MEM_freeN)(void *vmemh)
void *(* MEM_callocN)(size_t len, const char *str)
void *(* MEM_mallocN)(size_t len, const char *str)
LockfreeLinkNode dummy_node
struct LockfreeLinkNode * next