~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_alloc.h

  • Committer: Toru Maesaka
  • Date: 2008-12-17 07:16:37 UTC
  • mto: (685.1.40 devel) (713.1.5 devel)
  • mto: This revision was merged to the branch mainline in revision 713.
  • Revision ID: dev@torum.net-20081217071637-7j9040w7lpms77r2
Removed my_time() and added error checking

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
#define DRIZZLE_SERVER_SQL_ALLOC_H
22
22
 
23
23
#include <libdrizzle/net_serv.h>
24
 
 
25
 
void init_sql_alloc(MEM_ROOT *root, uint32_t block_size, uint32_t pre_alloc_size);
 
24
#include <mysys/my_alloc.h>
 
25
#include <mystrings/m_ctype.h>
 
26
 
 
27
class Session;
 
28
 
 
29
void init_sql_alloc(MEM_ROOT *root, size_t block_size, size_t pre_alloc_size);
26
30
void *sql_alloc(size_t);
27
31
void *sql_calloc(size_t);
28
32
char *sql_strdup(const char *str);
34
38
                               size_t max_res_length,
35
39
                               const CHARSET_INFO * const to_cs,
36
40
                               size_t *result_length);
37
 
void sql_kill(THD *thd, ulong id, bool only_kill_query);
 
41
void sql_kill(Session *session, ulong id, bool only_kill_query);
38
42
bool net_request_file(NET* net, const char* fname);
39
 
char* query_table_status(THD *thd,const char *db,const char *table_name);
 
43
char* query_table_status(Session *session,const char *db,const char *table_name);
 
44
 
 
45
/* mysql standard class memory allocator */
 
46
class Sql_alloc
 
47
{
 
48
public:
 
49
  static void *operator new(size_t size) throw ()
 
50
  {
 
51
    return sql_alloc(size);
 
52
  }
 
53
  static void *operator new[](size_t size)
 
54
  {
 
55
    return sql_alloc(size);
 
56
  }
 
57
  static void *operator new[](size_t size, MEM_ROOT *mem_root) throw ()
 
58
  { return alloc_root(mem_root, size); }
 
59
  static void *operator new(size_t size, MEM_ROOT *mem_root) throw ()
 
60
  { return alloc_root(mem_root, size); }
 
61
  static void operator delete(void *, size_t)
 
62
  {  }
 
63
  static void operator delete(void *, MEM_ROOT *)
 
64
  { /* never called */ }
 
65
  static void operator delete[](void *, MEM_ROOT *)
 
66
  { /* never called */ }
 
67
  static void operator delete[](void *, size_t)
 
68
  {  }
 
69
#ifdef HAVE_purify
 
70
  bool dummy;
 
71
  inline Sql_alloc() :dummy(0) {}
 
72
  inline ~Sql_alloc() {}
 
73
#else
 
74
  inline Sql_alloc() {}
 
75
  inline ~Sql_alloc() {}
 
76
#endif
 
77
 
 
78
};
40
79
 
41
80
#endif /* DRIZZLE_SERVER_SQL_ALLOC_H */