~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to mysys/my_alloc.h

  • Committer: Monty Taylor
  • Date: 2008-10-13 09:29:43 UTC
  • mfrom: (509 drizzle)
  • mto: (509.1.4 codestyle)
  • mto: This revision was merged to the branch mainline in revision 511.
  • Revision ID: monty@inaugust.com-20081013092943-rwvx4a6d85b5l2dh
MergedĀ inĀ trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
#ifndef _my_alloc_h
21
21
#define _my_alloc_h
22
22
 
 
23
#if defined(__cplusplus)
 
24
extern "C" {
 
25
#endif
 
26
 
23
27
#define ALLOC_MAX_BLOCK_TO_DROP                 4096
24
28
#define ALLOC_MAX_BLOCK_USAGE_BEFORE_DROP       10
25
29
 
48
52
 
49
53
  void (*error_handler)(void);
50
54
} MEM_ROOT;
 
55
 
 
56
void init_alloc_root(MEM_ROOT *mem_root, size_t block_size,
 
57
                     size_t pre_alloc_size);
 
58
void *alloc_root(MEM_ROOT *mem_root, size_t Size);
 
59
void *multi_alloc_root(MEM_ROOT *mem_root, ...);
 
60
void free_root(MEM_ROOT *root, myf MyFLAGS);
 
61
void set_prealloc_root(MEM_ROOT *root, char *ptr);
 
62
void reset_root_defaults(MEM_ROOT *mem_root, size_t block_size,
 
63
                         size_t prealloc_size);
 
64
char *strdup_root(MEM_ROOT *root,const char *str);
 
65
char *strmake_root(MEM_ROOT *root,const char *str,size_t len);
 
66
void *memdup_root(MEM_ROOT *root,const void *str, size_t len);
 
67
 
 
68
#if defined(__cplusplus)
 
69
}
 
70
#endif
51
71
#endif