~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/internal/default.cc

  • Committer: mordred
  • Date: 2010-04-20 00:04:22 UTC
  • mfrom: (1491 bad-staging)
  • mto: This revision was merged to the branch mainline in revision 1498.
  • Revision ID: mordred@orisndriz09-20100420000422-if6mil1596804mrj
Merged up with build.

Show diffs side-by-side

added added

removed removed

Lines of Context:
181
181
    TYPELIB *group= ctx->group;
182
182
 
183
183
    if (!(extra_groups=
184
 
          (const char**)alloc_root(ctx->alloc,
 
184
          (const char**)ctx->alloc->alloc_root(
185
185
                                   (2*group->count+1)*sizeof(char*))))
186
186
      goto err;
187
187
 
191
191
      extra_groups[i]= group->type_names[i]; /** copy group */
192
192
 
193
193
      len= strlen(extra_groups[i]);
194
 
      if (!(ptr= (char *)alloc_root(ctx->alloc, len+instance_len+1)))
 
194
      if (!(ptr= (char *)ctx->alloc->alloc_root( len+instance_len+1)))
195
195
        goto err;
196
196
 
197
197
      extra_groups[i+group->count]= ptr;
289
289
 
290
290
  if (find_type((char *)group_name, ctx->group, 3))
291
291
  {
292
 
    if (!(tmp= (char *)alloc_root(ctx->alloc, strlen(option) + 1)))
 
292
    if (!(tmp= (char *)ctx->alloc->alloc_root(strlen(option) + 1)))
293
293
      return 1;
294
294
    if (insert_dynamic(ctx->args, (unsigned char*) &tmp))
295
295
      return 1;
402
402
  bool found_print_defaults= 0;
403
403
  uint32_t args_used= 0;
404
404
  int error= 0;
405
 
  memory::Root alloc;
 
405
  memory::Root alloc(512);
406
406
  char *ptr,**res;
407
407
  struct handle_option_ctx ctx;
408
408
 
409
409
  init_default_directories();
410
 
  init_alloc_root(&alloc,512);
411
410
  /*
412
411
    Check if the user doesn't want any default option processing
413
412
    --no-defaults is always the first option
416
415
  {
417
416
    /* remove the --no-defaults argument and return only the other arguments */
418
417
    uint32_t i;
419
 
    if (!(ptr=(char*) alloc_root(&alloc,sizeof(alloc)+
420
 
                                 (*argc + 1)*sizeof(char*))))
 
418
    if (!(ptr=(char*) alloc.alloc_root(sizeof(alloc)+ (*argc + 1)*sizeof(char*))))
421
419
      goto err;
422
420
    res= (char**) (ptr+sizeof(alloc));
423
421
    memset(res,0,(*argc + 1));
451
449
    Here error contains <> 0 only if we have a fully specified conf_file
452
450
    or a forced default file
453
451
  */
454
 
  if (!(ptr=(char*) alloc_root(&alloc,sizeof(alloc)+
455
 
                               (args.elements + *argc +1) *sizeof(char*))))
 
452
  if (!(ptr=(char*) alloc.alloc_root(sizeof(alloc)+ (args.elements + *argc +1) *sizeof(char*))))
456
453
    goto err;
457
454
  res= (char**) (ptr+sizeof(alloc));
458
455
 
503
500
{
504
501
  memory::Root ptr;
505
502
  memcpy(&ptr, (char*) argv - sizeof(ptr), sizeof(ptr));
506
 
  free_root(&ptr,MYF(0));
 
503
  ptr.free_root(MYF(0));
507
504
}
508
505
 
509
506