~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/internal/default.cc

  • Committer: Monty Taylor
  • Date: 2009-12-25 08:50:15 UTC
  • mto: This revision was merged to the branch mainline in revision 1255.
  • Revision ID: mordred@inaugust.com-20091225085015-83sux5qsvy312gew
MEM_ROOT == memory::Root

Show diffs side-by-side

added added

removed removed

Lines of Context:
49
49
#include <algorithm>
50
50
 
51
51
 
 
52
using namespace drizzled;
52
53
using namespace std;
53
54
 
54
55
const char *my_defaults_file=0;
74
75
 
75
76
struct handle_option_ctx
76
77
{
77
 
   MEM_ROOT *alloc;
 
78
   memory::Root *alloc;
78
79
   DYNAMIC_ARRAY *args;
79
80
   TYPELIB *group;
80
81
};
385
386
  bool found_print_defaults= 0;
386
387
  uint32_t args_used= 0;
387
388
  int error= 0;
388
 
  MEM_ROOT alloc;
 
389
  memory::Root alloc;
389
390
  char *ptr,**res;
390
391
  struct handle_option_ctx ctx;
391
392
 
410
411
    res[i-1]=0;                                 /* End pointer */
411
412
    (*argc)--;
412
413
    *argv=res;
413
 
    *(MEM_ROOT*) ptr= alloc;                    /* Save alloc root for free */
 
414
    *(memory::Root*) ptr= alloc;                        /* Save alloc root for free */
414
415
    return(0);
415
416
  }
416
417
 
462
463
 
463
464
  (*argc)+=int(args.elements);
464
465
  *argv= static_cast<char**>(res);
465
 
  *(MEM_ROOT*) ptr= alloc;                      /* Save alloc root for free */
 
466
  *(memory::Root*) ptr= alloc;                  /* Save alloc root for free */
466
467
  delete_dynamic(&args);
467
468
  if (found_print_defaults)
468
469
  {
484
485
 
485
486
void free_defaults(char **argv)
486
487
{
487
 
  MEM_ROOT ptr;
 
488
  memory::Root ptr;
488
489
  memcpy(&ptr, (char*) argv - sizeof(ptr), sizeof(ptr));
489
490
  free_root(&ptr,MYF(0));
490
491
}