MySQL 8.0.40
Source Code Documentation
ut0vec.ic File Reference

A vector of pointers to data items. More...

#include "ut0new.h"

Macros

#define IB_VEC_OFFSET(v, i)   (vec->sizeof_value * i)
 

Functions

static void * ib_heap_malloc (ib_alloc_t *allocator, ulint size)
 
static void ib_heap_free (ib_alloc_t *allocator, void *ptr)
 
static void * ib_heap_resize (ib_alloc_t *allocator, void *old_ptr, ulint old_size, ulint new_size)
 
static ib_alloc_tib_heap_allocator_create (mem_heap_t *heap)
 
static void ib_heap_allocator_free (ib_alloc_t *ib_ut_alloc)
 
static ulint ib_vector_size (const ib_vector_t *vec)
 
static void * ib_vector_get (ib_vector_t *vec, ulint n)
 Get n'th element. More...
 
static const void * ib_vector_get_const (const ib_vector_t *vec, ulint n)
 
static void * ib_vector_get_last (ib_vector_t *vec)
 Get last element. More...
 
static void ib_vector_set (ib_vector_t *vec, ulint n, void *elem)
 Set the n'th element. More...
 
static void ib_vector_reset (ib_vector_t *vec)
 
static void * ib_vector_last (ib_vector_t *vec)
 
static const void * ib_vector_last_const (const ib_vector_t *vec)
 
static void * ib_vector_pop (ib_vector_t *vec)
 Remove the last element from the vector. More...
 
static void * ib_vector_push (ib_vector_t *vec, const void *elem)
 
static void * ib_vector_remove (ib_vector_t *vec, const void *elem)
 Remove an element to the vector. More...
 
static void ib_vector_sort (ib_vector_t *vec, ib_compare_t compare)
 
static void ib_vector_free (ib_vector_t *vec)
 
static bool ib_vector_is_empty (const ib_vector_t *vec)
 

Detailed Description

A vector of pointers to data items.

Created 4/6/2006 Osku Salerma

Macro Definition Documentation

◆ IB_VEC_OFFSET

#define IB_VEC_OFFSET (   v,
 
)    (vec->sizeof_value * i)

Function Documentation

◆ ib_heap_allocator_create()

static ib_alloc_t * ib_heap_allocator_create ( mem_heap_t heap)
inlinestatic

◆ ib_heap_allocator_free()

static void ib_heap_allocator_free ( ib_alloc_t ib_ut_alloc)
inlinestatic

◆ ib_heap_free()

static void ib_heap_free ( ib_alloc_t allocator,
void *  ptr 
)
inlinestatic

◆ ib_heap_malloc()

static void * ib_heap_malloc ( ib_alloc_t allocator,
ulint  size 
)
inlinestatic

◆ ib_heap_resize()

static void * ib_heap_resize ( ib_alloc_t allocator,
void *  old_ptr,
ulint  old_size,
ulint  new_size 
)
inlinestatic

◆ ib_vector_free()

static void ib_vector_free ( ib_vector_t vec)
inlinestatic

◆ ib_vector_get()

static void * ib_vector_get ( ib_vector_t vec,
ulint  n 
)
inlinestatic

Get n'th element.

Parameters
vecin: vector
nin: element index to get

◆ ib_vector_get_const()

static const void * ib_vector_get_const ( const ib_vector_t vec,
ulint  n 
)
inlinestatic

◆ ib_vector_get_last()

static void * ib_vector_get_last ( ib_vector_t vec)
inlinestatic

Get last element.

The vector must not be empty.

Returns
last element
Parameters
vecin: vector

◆ ib_vector_is_empty()

static bool ib_vector_is_empty ( const ib_vector_t vec)
inlinestatic
Parameters
vecin: vector

◆ ib_vector_last()

static void * ib_vector_last ( ib_vector_t vec)
inlinestatic

◆ ib_vector_last_const()

static const void * ib_vector_last_const ( const ib_vector_t vec)
inlinestatic

◆ ib_vector_pop()

static void * ib_vector_pop ( ib_vector_t vec)
inlinestatic

Remove the last element from the vector.

Returns
last vector element

◆ ib_vector_push()

static void * ib_vector_push ( ib_vector_t vec,
const void *  elem 
)
inlinestatic

◆ ib_vector_remove()

static void * ib_vector_remove ( ib_vector_t vec,
const void *  elem 
)
inlinestatic

Remove an element to the vector.

Returns
pointer to the "removed" element
Parameters
vecin: vector
elemin: value to remove

◆ ib_vector_reset()

static void ib_vector_reset ( ib_vector_t vec)
inlinestatic

◆ ib_vector_set()

static void ib_vector_set ( ib_vector_t vec,
ulint  n,
void *  elem 
)
inlinestatic

Set the n'th element.

Parameters
vecin/out: vector
nin: element index to set
elemin: data element

◆ ib_vector_size()

static ulint ib_vector_size ( const ib_vector_t vec)
inlinestatic

◆ ib_vector_sort()

static void ib_vector_sort ( ib_vector_t vec,
ib_compare_t  compare 
)
inlinestatic