From 347ca5ea4efd1f76d79e4555e5e2d611963c9672 Mon Sep 17 00:00:00 2001 From: "bell@sanja.is.com.ua" <> Date: Thu, 27 Jun 2002 12:26:51 +0300 Subject: improvement in root memory allocator --- include/my_alloc.h | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'include/my_alloc.h') 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; -- cgit v1.2.1