PostgreSQL Source Code
git master
|
#include "postgres.h"
#include "common/pg_prng.h"
#include "fmgr.h"
#include "lib/rbtree.h"
#include "utils/memutils.h"
Go to the source code of this file.
Data Structures | |
struct | IntRBTreeNode |
Typedefs | |
typedef struct IntRBTreeNode | IntRBTreeNode |
Functions | |
static int | irbt_cmp (const RBTNode *a, const RBTNode *b, void *arg) |
static void | irbt_combine (RBTNode *existing, const RBTNode *newdata, void *arg) |
static RBTNode * | irbt_alloc (void *arg) |
static void | irbt_free (RBTNode *node, void *arg) |
static RBTree * | create_int_rbtree (void) |
static int * | GetPermutation (int size) |
static void | rbt_populate (RBTree *tree, int size, int step) |
static void | testleftright (int size) |
static void | testrightleft (int size) |
static void | testfind (int size) |
static void | testfindltgt (int size) |
static void | testleftmost (int size) |
static void | testdelete (int size, int delsize) |
PG_FUNCTION_INFO_V1 (test_rb_tree) | |
Datum | test_rb_tree (PG_FUNCTION_ARGS) |
Variables | |
PG_MODULE_MAGIC | |
typedef struct IntRBTreeNode IntRBTreeNode |
|
static |
Definition at line 80 of file test_rbtree.c.
References irbt_alloc(), irbt_cmp(), irbt_combine(), irbt_free(), and rbt_create().
Referenced by testdelete(), testfind(), testfindltgt(), testleftmost(), testleftright(), and testrightleft().
|
static |
Definition at line 94 of file test_rbtree.c.
References i, j, palloc(), pg_global_prng_state, pg_prng_uint64_range(), and size.
Referenced by rbt_populate().
|
static |
Definition at line 64 of file test_rbtree.c.
References palloc().
Referenced by create_int_rbtree().
Definition at line 39 of file test_rbtree.c.
References a, b, and IntRBTreeNode::key.
Referenced by create_int_rbtree().
Definition at line 52 of file test_rbtree.c.
References elog, ERROR, and IntRBTreeNode::key.
Referenced by create_int_rbtree().
|
static |
PG_FUNCTION_INFO_V1 | ( | test_rb_tree | ) |
|
static |
Definition at line 127 of file test_rbtree.c.
References elog, ERROR, GetPermutation(), i, IntRBTreeNode::key, pfree(), rbt_insert(), size, and tree.
Referenced by testdelete(), testfind(), testfindltgt(), testleftmost(), testleftright(), and testrightleft().
Datum test_rb_tree | ( | PG_FUNCTION_ARGS | ) |
Definition at line 503 of file test_rbtree.c.
References elog, ERROR, Max, MaxAllocSize, PG_GETARG_INT32, PG_RETURN_VOID, size, testdelete(), testfind(), testfindltgt(), testleftmost(), testleftright(), and testrightleft().
|
static |
Definition at line 409 of file test_rbtree.c.
References create_int_rbtree(), elog, ERROR, find(), i, IntRBTreeNode::key, palloc(), palloc0(), pfree(), pg_global_prng_state, pg_prng_uint64_range(), rbt_delete(), rbt_find(), rbt_leftmost(), rbt_populate(), size, and tree.
Referenced by test_rb_tree().
|
static |
Definition at line 243 of file test_rbtree.c.
References create_int_rbtree(), elog, ERROR, i, IntRBTreeNode::key, rbt_find(), rbt_populate(), size, and tree.
Referenced by test_rb_tree().
|
static |
Definition at line 287 of file test_rbtree.c.
References create_int_rbtree(), elog, ERROR, IntRBTreeNode::key, pg_global_prng_state, pg_prng_uint64_range(), rbt_delete(), rbt_find_great(), rbt_find_less(), rbt_populate(), size, and tree.
Referenced by test_rb_tree().
|
static |
Definition at line 387 of file test_rbtree.c.
References create_int_rbtree(), elog, ERROR, IntRBTreeNode::key, rbt_leftmost(), rbt_populate(), size, and tree.
Referenced by test_rb_tree().
|
static |
Definition at line 164 of file test_rbtree.c.
References create_int_rbtree(), elog, ERROR, IntRBTreeNode::key, LeftRightWalk, rbt_begin_iterate(), rbt_iterate(), rbt_populate(), size, and tree.
Referenced by test_rb_tree().
|
static |
Definition at line 204 of file test_rbtree.c.
References create_int_rbtree(), elog, ERROR, IntRBTreeNode::key, rbt_begin_iterate(), rbt_iterate(), rbt_populate(), RightLeftWalk, size, and tree.
Referenced by test_rb_tree().
PG_MODULE_MAGIC |
Definition at line 21 of file test_rbtree.c.