summaryrefslogtreecommitdiff
path: root/mysys
diff options
context:
space:
mode:
authorunknown <thek@kpdesk.mysql.com>2007-01-11 15:25:13 +0100
committerunknown <thek@kpdesk.mysql.com>2007-01-11 15:25:13 +0100
commit82b248259f36aa3fda5bdef2c4f376c873b846d7 (patch)
treeb25353af0108b938864c6e0263901bdaf16463a7 /mysys
parented20d0e92d9d6938d326d4199c24085425bfe577 (diff)
parent8aa8dd0ed04cda843620ac64ffbca70eb7d0f90f (diff)
downloadmariadb-git-82b248259f36aa3fda5bdef2c4f376c873b846d7.tar.gz
Merge kpettersson@bk-internal:/home/bk/mysql-5.1-maint
into kpdesk.mysql.com:/home/thek/dev/mysql-5.1-maint mysys/mf_iocache.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 f8b4434a936..25c8ceeff8b 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));
}
}