~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/myisam/mf_keycache.c

  • Committer: Brian Aker
  • Date: 2008-08-11 04:35:13 UTC
  • Revision ID: brian@tangent.org-20080811043513-hs4fkhbsnehlhr2c
First pass in removing ulong from MyISAM

Show diffs side-by-side

added added

removed removed

Lines of Context:
216
216
static void free_block(KEY_CACHE *keycache, BLOCK_LINK *block);
217
217
 
218
218
#define KEYCACHE_HASH(f, pos)                                                 \
219
 
(((ulong) ((pos) / keycache->key_cache_block_size) +                          \
220
 
                                     (ulong) (f)) & (keycache->hash_entries-1))
 
219
(((uint32_t) ((pos) / keycache->key_cache_block_size) +                          \
 
220
                                     (uint32_t) (f)) & (keycache->hash_entries-1))
221
221
#define FILE_HASH(f)                 ((uint) (f) & (CHANGED_BLOCKS_HASH-1))
222
222
 
223
223
#define BLOCK_NUMBER(b)                                                       \
271
271
                   size_t use_mem, uint division_limit,
272
272
                   uint age_threshold)
273
273
{
274
 
  ulong blocks, hash_links;
 
274
  uint32_t blocks, hash_links;
275
275
  size_t length;
276
276
  int error;
277
277
  assert(key_cache_block_size >= 512);
303
303
  keycache->key_cache_mem_size= use_mem;
304
304
  keycache->key_cache_block_size= key_cache_block_size;
305
305
 
306
 
  blocks= (ulong) (use_mem / (sizeof(BLOCK_LINK) + 2 * sizeof(HASH_LINK) +
 
306
  blocks= (uint32_t) (use_mem / (sizeof(BLOCK_LINK) + 2 * sizeof(HASH_LINK) +
307
307
                              sizeof(HASH_LINK*) * 5/4 + key_cache_block_size));
308
308
  /* It doesn't make sense to have too few blocks (less than 8) */
309
309
  if (blocks >= 8)
1774
1774
        {
1775
1775
          /* There are some never used blocks, take first of them */
1776
1776
          assert(keycache->blocks_used <
1777
 
                      (ulong) keycache->disk_blocks);
 
1777
                      (uint32_t) keycache->disk_blocks);
1778
1778
          block= &keycache->block_root[keycache->blocks_used];
1779
1779
          block->buffer= ADD_TO_PTR(keycache->block_mem,
1780
 
                                    ((ulong) keycache->blocks_used*
 
1780
                                    ((uint32_t) keycache->blocks_used*
1781
1781
                                     keycache->key_cache_block_size),
1782
1782
                                    uchar*);
1783
1783
          keycache->blocks_used++;
3798
3798
      page= (KEYCACHE_PAGE *) thread->opt_info;
3799
3799
      fprintf(keycache_dump_file,
3800
3800
              "thread:%u, (file,filepos)=(%u,%lu)\n",
3801
 
              thread->id,(uint) page->file,(ulong) page->filepos);
 
3801
              thread->id,(uint) page->file,(uint32_t) page->filepos);
3802
3802
      if (++i == MAX_QUEUE_LEN)
3803
3803
        break;
3804
3804
    }
3813
3813
      thread=thread->next;
3814
3814
      hash_link= (HASH_LINK *) thread->opt_info;
3815
3815
      fprintf(keycache_dump_file,
3816
 
        "thread:%u hash_link:%u (file,filepos)=(%u,%lu)\n",
 
3816
        "thread:%u hash_link:%u (file,filepos)=(%u,%u)\n",
3817
3817
        thread->id, (uint) HASH_LINK_NUMBER(hash_link),
3818
 
        (uint) hash_link->file,(ulong) hash_link->diskpos);
 
3818
        (uint) hash_link->file,(uint32_t) hash_link->diskpos);
3819
3819
      if (++i == MAX_QUEUE_LEN)
3820
3820
        break;
3821
3821
    }