Permalink
Browse files

让 map --mem 不再从低端开始寻找可用内存块,而总是使用最高端的可用内存块。(不点)

  • Loading branch information...
1 parent b5e9c93 commit ca0371bb1e2365bfe4e44031a3b8b59e8c58ce0d yaya committed Dec 24, 2016
Showing with 7 additions and 6 deletions.
  1. +7 −6 stage2/builtins.c
View
@@ -10362,19 +10362,20 @@ map_func (char *arg, int flags)
|| tmpbase + bytes_needed <= start_byte /* XXX: destination is below the gzip image */
|| tmpbase >= start_byte + to_filesize) /* XXX: destination is above the gzip image */
{
- if (prefer_top)
+ /* Comment out. Now we always prefer top. -- tinybit, 2016-12-21 */
+ //if (prefer_top)
{
if (base < tmpbase)
{
base = tmpbase; top_end = tmpend;
}
continue; // find available region with highest address
}
- else
- {
- base = tmpbase; top_end = tmpend;
- break; // use the first available region
- }
+ //else
+ //{
+ //base = tmpbase; top_end = tmpend;
+ //break; // use the first available region
+ //}
}
else
/* destination overlaps the gzip image */

0 comments on commit ca0371b

Please sign in to comment.