diff options
author | unknown <Kristofer.Pettersson@naruto.> | 2007-01-11 13:13:06 +0100 |
---|---|---|
committer | unknown <Kristofer.Pettersson@naruto.> | 2007-01-11 13:13:06 +0100 |
commit | 7ae7a21ed22adc5e57aab5d8d577b6a10399a801 (patch) | |
tree | 444349b5974f27f241b54034a55a757ae4cc97cc /mysys | |
parent | 8f27663e92910f9963e5a6415787d855782c0f52 (diff) | |
parent | 9466d6e60fc53ba5f0f98480f82e1676ab2306d2 (diff) | |
download | mariadb-git-7ae7a21ed22adc5e57aab5d8d577b6a10399a801.tar.gz |
Merge naruto.:C:/cpp/bug24751/my41-bug24751
into naruto.:C:/cpp/mysql-4.1-maint
Diffstat (limited to 'mysys')
-rw-r--r-- | mysys/mf_iocache.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/mysys/mf_iocache.c b/mysys/mf_iocache.c index b17df3da260..a91002d3b4c 100644 --- a/mysys/mf_iocache.c +++ b/mysys/mf_iocache.c @@ -199,11 +199,11 @@ int init_io_cache(IO_CACHE *info, File file, uint cachesize, if (type != READ_NET && type != WRITE_NET) { /* Retry allocating memory in smaller blocks until we get one */ + cachesize=(uint) ((ulong) (cachesize + min_cache-1) & + (ulong) ~(min_cache-1)); for (;;) { uint buffer_block; - cachesize=(uint) ((ulong) (cachesize + min_cache-1) & - (ulong) ~(min_cache-1)); if (cachesize < min_cache) cachesize = min_cache; buffer_block = cachesize; @@ -222,7 +222,8 @@ int init_io_cache(IO_CACHE *info, File file, uint cachesize, } if (cachesize == min_cache) DBUG_RETURN(2); /* Can't alloc cache */ - cachesize= (uint) ((long) cachesize*3/4); /* Try with less memory */ + /* Try with less memory */ + cachesize= (uint) ((ulong) cachesize*3/4 & (ulong)~(min_cache-1)); } } |