~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/myisam/mi_close.c

Renamed strings to mystrings, for include/lib naming consistency.

Show diffs side-by-side

added added

removed removed

Lines of Context:
56
56
  myisam_open_list=list_delete(myisam_open_list,&info->open_list);
57
57
  pthread_mutex_unlock(&share->intern_lock);
58
58
 
59
 
  void * rec_buff_ptr= mi_get_rec_buff_ptr(info, info->rec_buff);
60
 
  if (rec_buff_ptr != NULL)
61
 
    free(rec_buff_ptr);
 
59
  my_free(mi_get_rec_buff_ptr(info, info->rec_buff), MYF(MY_ALLOW_ZERO_PTR));
62
60
  if (flag)
63
61
  {
64
62
    if (share->kfile >= 0 &&
79
77
      if (my_close(share->kfile,MYF(0)))
80
78
        error = my_errno;
81
79
    }
 
80
#ifdef HAVE_MMAP
 
81
    if (share->file_map)
 
82
      _mi_unmap_file(info);
 
83
#endif
82
84
    if (share->decode_trees)
83
85
    {
84
 
      free((unsigned char*) share->decode_trees);
85
 
      free((unsigned char*) share->decode_tables);
 
86
      my_free((uchar*) share->decode_trees,MYF(0));
 
87
      my_free((uchar*) share->decode_tables,MYF(0));
86
88
    }
87
89
    thr_lock_delete(&share->lock);
88
 
    pthread_mutex_destroy(&share->intern_lock);
 
90
    VOID(pthread_mutex_destroy(&share->intern_lock));
89
91
    {
90
92
      int i,keys;
91
93
      keys = share->state.header.keys;
92
 
      rwlock_destroy(&share->mmap_lock);
 
94
      VOID(rwlock_destroy(&share->mmap_lock));
93
95
      for(i=0; i<keys; i++) {
94
 
        rwlock_destroy(&share->key_root_lock[i]);
 
96
        VOID(rwlock_destroy(&share->key_root_lock[i]));
95
97
      }
96
98
    }
97
 
    free((unsigned char*) info->s);
 
99
    my_free((uchar*) info->s,MYF(0));
98
100
  }
99
101
  pthread_mutex_unlock(&THR_LOCK_myisam);
100
102
 
101
103
  if (info->dfile >= 0 && my_close(info->dfile,MYF(0)))
102
104
    error = my_errno;
103
105
 
104
 
  free((unsigned char*) info);
 
106
  myisam_log_command(MI_LOG_CLOSE,info,NULL,0,error);
 
107
  my_free((uchar*) info,MYF(0));
105
108
 
106
109
  if (error)
107
110
  {