MySQL 9.0.0
Source Code Documentation
ha0storage.ic File Reference

Hash storage. More...

#include "ha0storage.h"
#include "hash0hash.h"
#include "mem0mem.h"
#include "univ.i"

Classes

struct  ha_storage_t
 Hash storage for strings. More...
 
struct  ha_storage_node_t
 Objects of this type are stored in ha_storage_t. More...
 

Functions

static ha_storage_tha_storage_create (ulint initial_heap_bytes, ulint initial_hash_cells)
 Creates a hash storage. More...
 
static void ha_storage_empty (ha_storage_t **storage)
 Empties a hash storage, freeing memory occupied by data chunks. More...
 
static void ha_storage_free (ha_storage_t *storage)
 Frees a hash storage and everything it contains, it cannot be used after this call. More...
 
static ulint ha_storage_get_size (const ha_storage_t *storage)
 Gets the size of the memory used by a storage. More...
 

Detailed Description

Hash storage.

Provides a data structure that stores chunks of data in its own storage, avoiding duplicates.

Created September 24, 2007 Vasil Dimov

Function Documentation

◆ ha_storage_create()

static ha_storage_t * ha_storage_create ( ulint  initial_heap_bytes,
ulint  initial_hash_cells 
)
inlinestatic

Creates a hash storage.

If any of the parameters is 0, then a default value is used.

Returns
own: hash storage
Parameters
initial_heap_bytesin: initial heap's size
initial_hash_cellsin: initial number of cells in the hash table

◆ ha_storage_empty()

static void ha_storage_empty ( ha_storage_t **  storage)
inlinestatic

Empties a hash storage, freeing memory occupied by data chunks.

This invalidates any pointers previously returned by ha_storage_put(). The hash storage is not invalidated itself and can be used again.

Parameters
storagein/out: hash storage

◆ ha_storage_free()

static void ha_storage_free ( ha_storage_t storage)
inlinestatic

Frees a hash storage and everything it contains, it cannot be used after this call.

This invalidates any pointers previously returned by ha_storage_put().

Parameters
storagein, own: hash storage

◆ ha_storage_get_size()

static ulint ha_storage_get_size ( const ha_storage_t storage)
inlinestatic

Gets the size of the memory used by a storage.

Returns
bytes used
Parameters
storagein: hash storage