~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/internal/my_lib.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:
22
22
#include "drizzled/my_error.h"
23
23
#include "drizzled/internal/my_dir.h"   /* Structs used by my_dir,includes sys/types */
24
24
 
 
25
using namespace drizzled;
 
26
 
25
27
#if defined(HAVE_READDIR_R)
26
28
#define READDIR(A,B,C) ((errno=readdir_r(A,B,&C)) != 0 || !C)
27
29
#else 
49
51
  {
50
52
    delete_dynamic((DYNAMIC_ARRAY*)((char*)buffer +
51
53
                                    ALIGN_SIZE(sizeof(MY_DIR))));
52
 
    free_root((MEM_ROOT*)((char*)buffer + ALIGN_SIZE(sizeof(MY_DIR)) +
 
54
    free_root((memory::Root*)((char*)buffer + ALIGN_SIZE(sizeof(MY_DIR)) +
53
55
                          ALIGN_SIZE(sizeof(DYNAMIC_ARRAY))), MYF(0));
54
56
    free((unsigned char*) buffer);
55
57
  }
71
73
  MY_DIR        *result= 0;
72
74
  FILEINFO      finfo;
73
75
  DYNAMIC_ARRAY *dir_entries_storage;
74
 
  MEM_ROOT      *names_storage;
 
76
  memory::Root      *names_storage;
75
77
  DIR           *dirp;
76
78
  struct dirent *dp;
77
79
  char          tmp_path[FN_REFLEN+1],*tmp_file;
81
83
  if (dirp == NULL ||
82
84
      ! (buffer= (char *) malloc(ALIGN_SIZE(sizeof(MY_DIR)) + 
83
85
                                 ALIGN_SIZE(sizeof(DYNAMIC_ARRAY)) +
84
 
                                 sizeof(MEM_ROOT))))
 
86
                                 sizeof(memory::Root))))
85
87
    goto error;
86
88
 
87
89
  dir_entries_storage= (DYNAMIC_ARRAY*)(buffer + ALIGN_SIZE(sizeof(MY_DIR)));
88
 
  names_storage= (MEM_ROOT*)(buffer + ALIGN_SIZE(sizeof(MY_DIR)) +
 
90
  names_storage= (memory::Root*)(buffer + ALIGN_SIZE(sizeof(MY_DIR)) +
89
91
                             ALIGN_SIZE(sizeof(DYNAMIC_ARRAY)));
90
92
 
91
93
  if (my_init_dynamic_array(dir_entries_storage, sizeof(FILEINFO),