~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/myisam/ha_myisam.cc

  • Committer: Monty Taylor
  • Date: 2009-09-22 22:19:58 UTC
  • mto: This revision was merged to the branch mainline in revision 1184.
  • Revision ID: mordred@inaugust.com-20090922221958-l4d9ogwfs55513eo
Moved multi_malloc into drizzled since it's not going away any time soon. Also,
cleaned it up a bit.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
#include "myisampack.h"
21
21
#include "ha_myisam.h"
22
22
#include "myisamdef.h"
23
 
#include <drizzled/util/test.h>
24
 
#include <drizzled/error.h>
25
 
#include <drizzled/errmsg_print.h>
26
 
#include <drizzled/gettext.h>
27
 
#include <drizzled/session.h>
28
 
#include <drizzled/table.h>
29
 
#include <drizzled/field/timestamp.h>
 
23
#include "mysys/my_bit.h"
 
24
#include "drizzled/util/test.h"
 
25
#include "drizzled/error.h"
 
26
#include "drizzled/errmsg_print.h"
 
27
#include "drizzled/gettext.h"
 
28
#include "drizzled/session.h"
 
29
#include "drizzled/plugin/protocol.h"
 
30
#include "drizzled/table.h"
 
31
#include "drizzled/field/timestamp.h"
 
32
#include "drizzled/memory/multi_malloc.h"
30
33
 
31
34
#include <string>
32
35
#include <algorithm>
116
119
    table conformance in merge engine.
117
120
 
118
121
    The caller needs to free *recinfo_out after use. Since *recinfo_out
119
 
    and *keydef_out are allocated with a my_multi_malloc, *keydef_out
 
122
    and *keydef_out are allocated with a multi_malloc, *keydef_out
120
123
    is freed automatically when *recinfo_out is freed.
121
124
 
122
125
  RETURN VALUE
136
139
  HA_KEYSEG *keyseg;
137
140
  TableShare *share= table_arg->s;
138
141
  uint32_t options= share->db_options_in_use;
139
 
  if (!(my_multi_malloc(MYF(MY_WME),
 
142
  if (!(drizzled::memory::multi_malloc(false,
140
143
          recinfo_out, (share->fields * 2 + 2) * sizeof(MI_COLUMNDEF),
141
144
          keydef_out, share->keys * sizeof(MI_KEYDEF),
142
 
          &keyseg,
143
 
          (share->key_parts + share->keys) * sizeof(HA_KEYSEG),
 
145
          &keyseg, (share->key_parts + share->keys) * sizeof(HA_KEYSEG),
144
146
          NULL)))
145
147
    return(HA_ERR_OUT_OF_MEM); /* purecov: inspected */
146
148
  keydef= *keydef_out;
565
567
  this->close();
566
568
 end:
567
569
  /*
568
 
    Both recinfo and keydef are allocated by my_multi_malloc(), thus only
 
570
    Both recinfo and keydef are allocated by multi_malloc(), thus only
569
571
    recinfo must be freed.
570
572
  */
571
573
  if (recinfo)