Commit 90bec9ce authored by unknown's avatar unknown

Merge naruto.:C:/cpp/bug24751/my50-bug24751

into  naruto.:C:/cpp/mysql-5.0-maint


mysys/mf_iocache.c:
  Auto merged
parents f7f69043 029d6cf9
...@@ -200,11 +200,11 @@ int init_io_cache(IO_CACHE *info, File file, uint cachesize, ...@@ -200,11 +200,11 @@ int init_io_cache(IO_CACHE *info, File file, uint cachesize,
if (type != READ_NET && type != WRITE_NET) if (type != READ_NET && type != WRITE_NET)
{ {
/* Retry allocating memory in smaller blocks until we get one */ /* Retry allocating memory in smaller blocks until we get one */
cachesize=(uint) ((ulong) (cachesize + min_cache-1) &
(ulong) ~(min_cache-1));
for (;;) for (;;)
{ {
uint buffer_block; uint buffer_block;
cachesize=(uint) ((ulong) (cachesize + min_cache-1) &
(ulong) ~(min_cache-1));
if (cachesize < min_cache) if (cachesize < min_cache)
cachesize = min_cache; cachesize = min_cache;
buffer_block = cachesize; buffer_block = cachesize;
...@@ -223,7 +223,8 @@ int init_io_cache(IO_CACHE *info, File file, uint cachesize, ...@@ -223,7 +223,8 @@ int init_io_cache(IO_CACHE *info, File file, uint cachesize,
} }
if (cachesize == min_cache) if (cachesize == min_cache)
DBUG_RETURN(2); /* Can't alloc 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));
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment