~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/myisam/mi_open.c

  • Committer: Monty Taylor
  • Date: 2008-10-06 02:57:23 UTC
  • Revision ID: monty@inaugust.com-20081006025723-qtlxseq8g3tg4imz
Made my_alloc actually always use malloc.

Show diffs side-by-side

added added

removed removed

Lines of Context:
69
69
    key_parts,unique_key_parts,fulltext_keys,uniques;
70
70
  char name_buff[FN_REFLEN], org_name[FN_REFLEN], index_name[FN_REFLEN],
71
71
       data_name[FN_REFLEN];
72
 
  uchar *disk_cache, *disk_pos, *end_pos;
 
72
  uchar *disk_cache= NULL;
 
73
  uchar *disk_pos, *end_pos;
73
74
  MI_INFO info,*m_info,*old_info;
74
75
  MYISAM_SHARE share_buff,*share;
75
76
  ulong rec_per_key_part[HA_MAX_POSSIBLE_KEY*MI_MAX_KEY_SEG];
142
143
 
143
144
    info_length=mi_uint2korr(share->state.header.header_length);
144
145
    base_pos=mi_uint2korr(share->state.header.base_pos);
145
 
    if (!(disk_cache= (uchar*) my_alloca(info_length+128)))
 
146
    if (!(disk_cache= (uchar*) malloc(info_length+128)))
146
147
    {
147
148
      my_errno=ENOMEM;
148
149
      goto err;
378
379
    share->data_file_type=STATIC_RECORD;
379
380
    if (share->options & HA_OPTION_PACK_RECORD)
380
381
      share->data_file_type = DYNAMIC_RECORD;
381
 
    my_afree(disk_cache);
 
382
    free(disk_cache);
 
383
    disk_cache= NULL;
382
384
    mi_setup_functions(share);
383
385
    share->is_log_table= false;
384
386
    thr_lock_init(&share->lock);
510
512
  return(m_info);
511
513
 
512
514
err:
 
515
  if (disk_cache != NULL)
 
516
    free(disk_cache);
513
517
  save_errno=my_errno ? my_errno : HA_ERR_END_OF_FILE;
514
518
  if ((save_errno == HA_ERR_CRASHED) ||
515
519
      (save_errno == HA_ERR_CRASHED_ON_USAGE) ||
529
533
    /* fall through */
530
534
  case 3:
531
535
    /* fall through */
532
 
  case 2:
533
 
    my_afree(disk_cache);
534
 
    /* fall through */
535
536
  case 1:
536
537
    my_close(kfile,MYF(0));
537
538
    /* fall through */