~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_alloc.h

  • Committer: Monty Taylor
  • Date: 2008-10-30 19:42:06 UTC
  • mto: (520.4.38 devel)
  • mto: This revision was merged to the branch mainline in revision 572.
  • Revision ID: monty@inaugust.com-20081030194206-fzus6yqlw1ekru65
Removed handler from common_includes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
 
23
23
#include <libdrizzle/net_serv.h>
24
24
 
 
25
 
25
26
void init_sql_alloc(MEM_ROOT *root, uint32_t block_size, uint32_t pre_alloc_size);
26
27
void *sql_alloc(size_t);
27
28
void *sql_calloc(size_t);
38
39
bool net_request_file(NET* net, const char* fname);
39
40
char* query_table_status(Session *session,const char *db,const char *table_name);
40
41
 
 
42
/* mysql standard class memory allocator */
 
43
class Sql_alloc
 
44
{
 
45
public:
 
46
  static void *operator new(size_t size) throw ()
 
47
  {
 
48
    return sql_alloc(size);
 
49
  }
 
50
  static void *operator new[](size_t size)
 
51
  {
 
52
    return sql_alloc(size);
 
53
  }
 
54
  static void *operator new[](size_t size, MEM_ROOT *mem_root) throw ()
 
55
  { return alloc_root(mem_root, size); }
 
56
  static void *operator new(size_t size, MEM_ROOT *mem_root) throw ()
 
57
  { return alloc_root(mem_root, size); }
 
58
  static void operator delete(void *ptr __attribute__((unused)),
 
59
                              size_t size __attribute__((unused)))
 
60
  { TRASH(ptr, size); }
 
61
  static void operator delete(void *ptr __attribute__((unused)),
 
62
                              MEM_ROOT *mem_root __attribute__((unused)))
 
63
  { /* never called */ }
 
64
  static void operator delete[](void *ptr __attribute__((unused)),
 
65
                                MEM_ROOT *mem_root __attribute__((unused)))
 
66
  { /* never called */ }
 
67
  static void operator delete[](void *ptr __attribute__((unused)),
 
68
                                size_t size __attribute__((unused)))
 
69
  { TRASH(ptr, size); }
 
70
#ifdef HAVE_purify
 
71
  bool dummy;
 
72
  inline Sql_alloc() :dummy(0) {}
 
73
  inline ~Sql_alloc() {}
 
74
#else
 
75
  inline Sql_alloc() {}
 
76
  inline ~Sql_alloc() {}
 
77
#endif
 
78
 
 
79
};
 
80
 
41
81
#endif /* DRIZZLE_SERVER_SQL_ALLOC_H */