MySQL 5.6.14 Source Code Document
|
#include "univ.i"
#include "ha0storage.h"
#include "hash0hash.h"
#include "mem0mem.h"
#include "ut0rnd.h"
Go to the source code of this file.
Macros | |
#define | IS_FOUND node->data_len == data_len && memcmp(node->data, data, data_len) == 0 |
Functions | |
UNIV_INTERN const void * | ha_storage_put_memlim (ha_storage_t *storage, const void *data, ulint data_len, ulint memlim) |
Hash storage. Provides a data structure that stores chunks of data in its own storage, avoiding duplicates.
Created September 22, 2007 Vasil Dimov
Definition in file ha0storage.cc.
UNIV_INTERN const void* ha_storage_put_memlim | ( | ha_storage_t * | storage, |
const void * | data, | ||
ulint | data_len, | ||
ulint | memlim | ||
) |
Copies data into the storage and returns a pointer to the copy. If the same data chunk is already present, then pointer to it is returned. Data chunks are considered to be equal if len1 == len2 and memcmp(data1, data2, len1) == 0. If "data" is not present (and thus data_len bytes need to be allocated) and the size of storage is going to become more than "memlim" then "data" is not added and NULL is returned. To disable this behavior "memlim" can be set to 0, which stands for "no limit".
storage | in/out: hash storage |
data | in: data to store |
data_len | in: data length |
memlim | in: memory limit to obey |
Definition at line 88 of file ha0storage.cc.