|
MySQL 5.6.14 Source Code Document
|
#include "mem0pool.h"#include "srv0srv.h"#include "sync0sync.h"#include "ut0mem.h"#include "ut0lst.h"#include "ut0byte.h"#include "mem0mem.h"#include "srv0start.h"
Go to the source code of this file.
Classes | |
| struct | mem_pool_t |
Macros | |
| #define | MEM_AREA_FREE 1 |
| #define | MEM_AREA_MIN_SIZE (2 * MEM_AREA_EXTRA_SIZE) |
Functions | |
| UNIV_INLINE void | mem_pool_mutex_enter (mem_pool_t *pool) |
| UNIV_INLINE void | mem_pool_mutex_exit (mem_pool_t *pool) |
| UNIV_INLINE ulint | mem_area_get_size (mem_area_t *area) |
| UNIV_INLINE void | mem_area_set_size (mem_area_t *area, ulint size) |
| UNIV_INLINE ibool | mem_area_get_free (mem_area_t *area) |
| UNIV_INLINE void | mem_area_set_free (mem_area_t *area, ibool free) |
| UNIV_INTERN mem_pool_t * | mem_pool_create (ulint size) |
| UNIV_INTERN void | mem_pool_free (mem_pool_t *pool) |
| UNIV_INTERN void * | mem_area_alloc (ulint *psize, mem_pool_t *pool) |
| UNIV_INLINE mem_area_t * | mem_area_get_buddy (mem_area_t *area, ulint size, mem_pool_t *pool) |
| UNIV_INTERN void | mem_area_free (void *ptr, mem_pool_t *pool) |
| UNIV_INTERN ibool | mem_pool_validate (mem_pool_t *pool) |
| UNIV_INTERN void | mem_pool_print_info (FILE *outfile, mem_pool_t *pool) |
| UNIV_INTERN ulint | mem_pool_get_reserved (mem_pool_t *pool) |
Variables | |
| UNIV_INTERN mem_pool_t * | mem_comm_pool = NULL |
| UNIV_INTERN ulint | mem_n_threads_inside = 0 |
| #define MEM_AREA_FREE 1 |
Mask used to extract the free bit from area->size
Definition at line 95 of file mem0pool.cc.
| #define MEM_AREA_MIN_SIZE (2 * MEM_AREA_EXTRA_SIZE) |
The smallest memory area total size
Definition at line 98 of file mem0pool.cc.
| UNIV_INTERN void* mem_area_alloc | ( | ulint * | psize, |
| mem_pool_t * | pool | ||
| ) |
Allocates memory from a pool. NOTE: This low-level function should only be used in mem0mem.*!
| psize | in: requested size in bytes; for optimum space usage, the size should be a power of 2 minus MEM_AREA_EXTRA_SIZE; out: allocated size in bytes (greater than or equal to the requested size) |
| pool | in: memory pool |
Definition at line 364 of file mem0pool.cc.


| UNIV_INTERN void mem_area_free | ( | void * | ptr, |
| mem_pool_t * | pool | ||
| ) |
Frees memory to a pool.
| ptr | in, own: pointer to allocated memory buffer |
| pool | in: memory pool |
Definition at line 506 of file mem0pool.cc.


| UNIV_INLINE mem_area_t* mem_area_get_buddy | ( | mem_area_t * | area, |
| ulint | size, | ||
| mem_pool_t * | pool | ||
| ) |
Gets the buddy of an area, if it exists in pool.
| area | in: memory area |
| size | in: memory area size |
| pool | in: memory pool |
Definition at line 467 of file mem0pool.cc.

| UNIV_INLINE ibool mem_area_get_free | ( | mem_area_t * | area | ) |
Returns memory area free bit.
| area | in: area |
Definition at line 189 of file mem0pool.cc.

| UNIV_INLINE ulint mem_area_get_size | ( | mem_area_t * | area | ) |
Returns memory area size.
| area | in: area |
Definition at line 164 of file mem0pool.cc.

| UNIV_INLINE void mem_area_set_free | ( | mem_area_t * | area, |
| ibool | free | ||
| ) |
Sets memory area free bit.
| area | in: area |
| free | in: free bit value |
Definition at line 203 of file mem0pool.cc.

| UNIV_INLINE void mem_area_set_size | ( | mem_area_t * | area, |
| ulint | size | ||
| ) |
Sets memory area size.
| area | in: area |
| size | in: size |
Definition at line 175 of file mem0pool.cc.

| UNIV_INTERN mem_pool_t* mem_pool_create | ( | ulint | size | ) |
Creates a memory pool.
| size | in: pool size in bytes |
Definition at line 220 of file mem0pool.cc.


| UNIV_INTERN void mem_pool_free | ( | mem_pool_t * | pool | ) |
Frees a memory pool.
| pool | in, own: memory pool |
Definition at line 279 of file mem0pool.cc.


| UNIV_INTERN ulint mem_pool_get_reserved | ( | mem_pool_t * | pool | ) |
Returns the amount of reserved memory.
| pool | in: memory pool |
Definition at line 714 of file mem0pool.cc.

| UNIV_INLINE void mem_pool_mutex_enter | ( | mem_pool_t * | pool | ) |
Reserves the mem pool mutex if we are not in server shutdown. Use this function only in memory free functions, since only memory free functions are used during server shutdown.
| pool | in: memory pool |
Definition at line 135 of file mem0pool.cc.

| UNIV_INLINE void mem_pool_mutex_exit | ( | mem_pool_t * | pool | ) |
Releases the mem pool mutex if we are not in server shutdown. As its corresponding mem_pool_mutex_enter() function, use it only in memory free functions
| pool | in: memory pool |
Definition at line 150 of file mem0pool.cc.

| UNIV_INTERN void mem_pool_print_info | ( | FILE * | outfile, |
| mem_pool_t * | pool | ||
| ) |
Prints info of a memory pool.
| outfile | in: output file to write to |
| pool | in: memory pool |
Definition at line 680 of file mem0pool.cc.

| UNIV_INTERN ibool mem_pool_validate | ( | mem_pool_t * | pool | ) |
Validates a memory pool.
| pool | in: memory pool |
Definition at line 636 of file mem0pool.cc.


| UNIV_INTERN mem_pool_t* mem_comm_pool = NULL |
The common memory pool
Definition at line 116 of file mem0pool.cc.