~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/myisam/mi_dynrec.cc

Merge Monty

Show diffs side-by-side

added added

removed removed

Lines of Context:
53
53
 
54
54
        /* Interface function from MI_INFO */
55
55
 
56
 
#ifdef HAVE_MMAP
57
56
 
58
57
/*
59
58
  Create mmaped area for MyISAM handler
82
81
      upon a write if no physical memory is available.
83
82
  */
84
83
  info->s->file_map= (unsigned char*)
85
 
                  my_mmap(0, (size_t)(size + MEMMAP_EXTRA_MARGIN),
86
 
                          info->s->mode==O_RDONLY ? PROT_READ :
87
 
                          PROT_READ | PROT_WRITE,
88
 
                          MAP_SHARED | MAP_NORESERVE,
89
 
                          info->dfile, 0L);
 
84
                  mmap(NULL, (size_t)(size + MEMMAP_EXTRA_MARGIN),
 
85
                       info->s->mode==O_RDONLY ? PROT_READ :
 
86
                       PROT_READ | PROT_WRITE,
 
87
                       MAP_SHARED | MAP_NORESERVE,
 
88
                       info->dfile, 0L);
90
89
  if (info->s->file_map == (unsigned char*) MAP_FAILED)
91
90
  {
92
91
    info->s->file_map= NULL;
93
92
    return(1);
94
93
  }
95
94
/* per krow we should look at removing the following code */
96
 
#if defined(HAVE_MADVISE) && !defined(TARGET_OS_SOLARIS)
 
95
#if !defined(TARGET_OS_SOLARIS)
97
96
  madvise((char*) info->s->file_map, size, MADV_RANDOM);
98
97
#endif
99
98
  info->s->mmaped_length= size;
115
114
{
116
115
  if (info->s->file_map)
117
116
  {
118
 
    my_munmap((char*) info->s->file_map,
119
 
              (size_t) info->s->mmaped_length + MEMMAP_EXTRA_MARGIN);
 
117
    munmap((char*) info->s->file_map,
 
118
           (size_t) info->s->mmaped_length + MEMMAP_EXTRA_MARGIN);
120
119
    mi_dynmap_file(info, size);
121
120
  }
122
121
}
123
 
#endif
124
122
 
125
123
 
126
124
/*