summaryrefslogtreecommitdiff
path: root/mysys
diff options
context:
space:
mode:
authorunknown <cmiller@zippy.cornsilk.net>2007-01-11 09:44:39 -0500
committerunknown <cmiller@zippy.cornsilk.net>2007-01-11 09:44:39 -0500
commit113b784b36172f8c2397292f939f88e709534da4 (patch)
tree952691f9cd5aab6f8d9b7ef70a0f657987979599 /mysys
parentc97f7e7cb9b47d3ab14ae1e04f8c376dec7e537f (diff)
parent4c50203d4bb57ed79f1e9c703c18d23c9f9d72da (diff)
downloadmariadb-git-113b784b36172f8c2397292f939f88e709534da4.tar.gz
Merge bk-internal.mysql.com:/home/bk/mysql-5.0-maint
into zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.0-maint mysys/mf_iocache.c: Auto merged mysys/my_seek.c: Auto merged
Diffstat (limited to 'mysys')
-rw-r--r--mysys/mf_iocache.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/mysys/mf_iocache.c b/mysys/mf_iocache.c
index d458bf528d0..fc81f0bad03 100644
--- a/mysys/mf_iocache.c
+++ b/mysys/mf_iocache.c
@@ -200,11 +200,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;
@@ -223,7 +223,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));
}
}