MySQL  8.0.22
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.


struct  ib_alloc_t
struct  ib_vector_t


#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)


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 *)


ib_vector_tib_vector_create (ib_alloc_t *alloc, ulint sizeof_value, ulint size)
UNIV_INLINE void ib_vector_free (ib_vector_t *vec)
UNIV_INLINE void * ib_vector_push (ib_vector_t *vec, const void *elem)
UNIV_INLINE void * ib_vector_pop (ib_vector_t *vec)
UNIV_INLINE void * ib_vector_remove (ib_vector_t *vec, const void *elem)
 Remove an element to the vector. More...
UNIV_INLINE ulint ib_vector_size (const ib_vector_t *vec)
void ib_vector_resize (ib_vector_t *vec)
UNIV_INLINE ibool ib_vector_is_empty (const ib_vector_t *vec)
 in: vector More...
UNIV_INLINE void * ib_vector_get (ib_vector_t *vec, ulint n)
 Get the n'th element. More...
UNIV_INLINE const void * ib_vector_get_const (const ib_vector_t *vec, ulint n)
UNIV_INLINE void * ib_vector_get_last (ib_vector_t *vec)
 Get last element. More...
UNIV_INLINE void ib_vector_set (ib_vector_t *vec, ulint n, void *elem)
 Set the n'th element. More...
UNIV_INLINE void ib_vector_reset (ib_vector_t *vec)
UNIV_INLINE void * ib_vector_last (ib_vector_t *vec)
UNIV_INLINE const void * ib_vector_last_const (const ib_vector_t *vec)
UNIV_INLINE void ib_vector_sort (ib_vector_t *vec, ib_compare_t compare)
UNIV_INLINE void ib_heap_free (ib_alloc_t *allocator, void *ptr)
UNIV_INLINE void * ib_heap_malloc (ib_alloc_t *allocator, ulint size)
UNIV_INLINE void * ib_heap_resize (ib_alloc_t *allocator, void *old_ptr, ulint old_size, ulint new_size)
UNIV_INLINE ib_alloc_tib_heap_allocator_create (mem_heap_t *heap)
UNIV_INLINE 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,
)    (*(void **)ib_vector_get(v, n))

◆ ib_vector_getp_const

#define ib_vector_getp_const (   v,
)    (*(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()

UNIV_INLINE ib_alloc_t* ib_heap_allocator_create ( mem_heap_t heap)

◆ ib_heap_allocator_free()

UNIV_INLINE void ib_heap_allocator_free ( ib_alloc_t ib_ut_alloc)

◆ ib_heap_free()

UNIV_INLINE void ib_heap_free ( ib_alloc_t allocator,
void *  ptr 

◆ ib_heap_malloc()

UNIV_INLINE void* ib_heap_malloc ( ib_alloc_t allocator,
ulint  size 

◆ ib_heap_resize()

UNIV_INLINE void* ib_heap_resize ( ib_alloc_t allocator,
void *  old_ptr,
ulint  old_size,
ulint  new_size 

◆ ib_vector_create()

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

◆ ib_vector_free()

UNIV_INLINE void ib_vector_free ( ib_vector_t vec)

◆ ib_vector_get()

UNIV_INLINE void* ib_vector_get ( ib_vector_t vec,
ulint  n 

Get the n'th element.

[in]nelement index to get
n'th element

◆ ib_vector_get_const()

UNIV_INLINE const void* ib_vector_get_const ( const ib_vector_t vec,
ulint  n 

◆ ib_vector_get_last()

UNIV_INLINE void* ib_vector_get_last ( ib_vector_t vec)

Get last element.

The vector must not be empty.

last element in: vector

◆ ib_vector_is_empty()

UNIV_INLINE ibool ib_vector_is_empty ( const ib_vector_t vec)

in: vector

◆ ib_vector_last()

UNIV_INLINE void* ib_vector_last ( ib_vector_t vec)

◆ ib_vector_last_const()

UNIV_INLINE const void* ib_vector_last_const ( const ib_vector_t vec)

◆ ib_vector_pop()

UNIV_INLINE void* ib_vector_pop ( ib_vector_t vec)

◆ ib_vector_push()

UNIV_INLINE void* ib_vector_push ( ib_vector_t vec,
const void *  elem 

◆ ib_vector_remove()

UNIV_INLINE void* ib_vector_remove ( ib_vector_t vec,
const void *  elem 

Remove an element to the vector.

[in]elemvalue to remove
pointer to the "removed" element

◆ ib_vector_reset()

UNIV_INLINE void ib_vector_reset ( ib_vector_t vec)

◆ ib_vector_resize()

void ib_vector_resize ( ib_vector_t vec)

◆ ib_vector_set()

UNIV_INLINE void ib_vector_set ( ib_vector_t vec,
ulint  n,
void *  elem 

Set the n'th element.

[in]nelement index to set
[in]elemdata element

◆ ib_vector_size()

UNIV_INLINE ulint ib_vector_size ( const ib_vector_t vec)

◆ ib_vector_sort()

UNIV_INLINE void ib_vector_sort ( ib_vector_t vec,
ib_compare_t  compare