MySQL 8.0.40
Source Code Documentation
ut0vec.h File Reference

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

#include "mem0mem.h"
#include "univ.i"
#include "ut0vec.ic"

Go to the source code of this file.

Classes

struct  ib_alloc_t
 
struct  ib_vector_t
 

Macros

#define ib_vector_getp(v, n)   (*(void **)ib_vector_get(v, n))
 
#define ib_vector_getp_const(v, n)   (*(void **)ib_vector_get_const(v, n))
 
#define ib_vector_allocator(v)   (v->allocator)
 

Typedefs

typedef void *(* ib_mem_alloc_t) (ib_alloc_t *allocator, ulint size)
 
typedef void(* ib_mem_free_t) (ib_alloc_t *allocator, void *ptr)
 
typedef void *(* ib_mem_resize_t) (ib_alloc_t *allocator, void *ptr, ulint old_size, ulint new_size)
 
typedef int(* ib_compare_t) (const void *, const void *)
 

Functions

ib_vector_tib_vector_create (ib_alloc_t *alloc, ulint sizeof_value, ulint size)
 
static void ib_vector_free (ib_vector_t *vec)
 
static void * ib_vector_push (ib_vector_t *vec, const void *elem)
 
static void * ib_vector_pop (ib_vector_t *vec)
 
static void * ib_vector_remove (ib_vector_t *vec, const void *elem)
 Remove an element to the vector. More...
 
static ulint ib_vector_size (const ib_vector_t *vec)
 
void ib_vector_resize (ib_vector_t *vec)
 
static bool ib_vector_is_empty (const ib_vector_t *vec)
 in: vector More...
 
static void * ib_vector_get (ib_vector_t *vec, ulint n)
 Get the 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_sort (ib_vector_t *vec, ib_compare_t compare)
 
static void ib_heap_free (ib_alloc_t *allocator, void *ptr)
 
static void * ib_heap_malloc (ib_alloc_t *allocator, ulint size)
 
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)
 

Detailed Description

A vector of pointers to data items.

Created 4/6/2006 Osku Salerma

Macro Definition Documentation

◆ ib_vector_allocator

#define ib_vector_allocator (   v)    (v->allocator)

◆ ib_vector_getp

#define ib_vector_getp (   v,
  n 
)    (*(void **)ib_vector_get(v, n))

◆ ib_vector_getp_const

#define ib_vector_getp_const (   v,
  n 
)    (*(void **)ib_vector_get_const(v, n))

Typedef Documentation

◆ ib_compare_t

typedef int(* ib_compare_t) (const void *, const void *)

◆ ib_mem_alloc_t

typedef void *(* ib_mem_alloc_t) ( ib_alloc_t *allocator, ulint size)

◆ ib_mem_free_t

typedef void(* ib_mem_free_t) (ib_alloc_t *allocator, void *ptr)

◆ ib_mem_resize_t

typedef void *(* ib_mem_resize_t) ( ib_alloc_t *allocator, void *ptr, ulint old_size, ulint new_size)

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_create()

ib_vector_t * ib_vector_create ( ib_alloc_t alloc,
ulint  sizeof_value,
ulint  size 
)

◆ 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 the n'th element.

Parameters
[in]vecvector
[in]nelement index to get
Returns
n'th element

◆ 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 in: vector

◆ ib_vector_is_empty()

static bool ib_vector_is_empty ( const ib_vector_t vec)
inlinestatic

in: 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

◆ 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.

Parameters
[in]vecvector
[in]elemvalue to remove
Returns
pointer to the "removed" element

◆ ib_vector_reset()

static void ib_vector_reset ( ib_vector_t vec)
inlinestatic

◆ ib_vector_resize()

void ib_vector_resize ( ib_vector_t vec)

◆ ib_vector_set()

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

Set the n'th element.

Parameters
[in]vecvector
[in]nelement index to set
[in]elemdata 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