summaryrefslogtreecommitdiff
path: root/include/my_alloc.h
diff options
context:
space:
mode:
authorunknown <bell@sanja.is.com.ua>2002-06-27 12:26:51 +0300
committerunknown <bell@sanja.is.com.ua>2002-06-27 12:26:51 +0300
commit6e0a4d3bbc2e85b78965ac533dccaa38175836ff (patch)
treeea0451695463acb4632e27fa003170aae7303dee /include/my_alloc.h
parentd58356a8daa49d1e9a361b9d49d3c7e59dd07ceb (diff)
downloadmariadb-git-6e0a4d3bbc2e85b78965ac533dccaa38175836ff.tar.gz
improvement in root memory allocator
Diffstat (limited to 'include/my_alloc.h')
-rw-r--r--include/my_alloc.h13
1 files changed, 10 insertions, 3 deletions
diff --git a/include/my_alloc.h b/include/my_alloc.h
index 60d0d4f4b6d..31f1fb7165f 100644
--- a/include/my_alloc.h
+++ b/include/my_alloc.h
@@ -21,6 +21,8 @@
#ifndef _my_alloc_h
#define _my_alloc_h
+#define MAX_BLOCK_USAGE_BEFORE_DROP 10
+
typedef struct st_used_mem
{ /* struct for once_alloc (block) */
struct st_used_mem *next; /* Next block in use */
@@ -35,9 +37,14 @@ typedef struct st_mem_root
USED_MEM *used; /* blocks almost without free memory */
USED_MEM *pre_alloc; /* preallocated block */
/* if block have less memory it will be put in 'used' list */
- unsigned int min_malloc;
- unsigned int block_size; /* initial block size */
- unsigned int block_num; /* allocated blocks counter */
+ unsigned int min_malloc;
+ unsigned int block_size; /* initial block size */
+ unsigned int block_num; /* allocated blocks counter */
+ /*
+ first free block in queue test counter (if it exceed
+ MAX_BLOCK_USAGE_BEFORE_DROP block will be droped in 'used' list)
+ */
+ unsigned int first_block_usage;
void (*error_handler)(void);
} MEM_ROOT;