~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to mysys/my_alloc.h

  • Committer: mordred
  • Date: 2008-11-01 00:46:20 UTC
  • mto: (572.1.1 devel) (575.1.1 devel)
  • mto: This revision was merged to the branch mainline in revision 573.
  • Revision ID: mordred@opensolaris-20081101004620-vd0kzsl9k40hvf4p
Some updates to dtrace support.

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