mirror of
https://git.savannah.gnu.org/git/grub.git
synced 2026-10-20 22:48:22 +00:00
* grub-core/kern/mm.c (grub_real_malloc): Don't update the pointer to
current memory when allocating large chunks. This significantly decreases memory fragmentation.
This commit is contained in:
1 parent
1bbb796799
commit
39ff43c579
2 files changed
+10
-1
No files matched your search
+4
-1
@@ -298,7 +298,10 @@ grub_real_malloc (grub_mm_header_t *first, grub_size_t n, grub_size_t align)
|
||||
/* Mark find as a start marker for next allocation to fasten it.
|
||||
This will have side effect of fragmenting memory as small
|
||||
pieces before this will be un-used. */
|
||||
*first = q;
|
||||
/* So do it only for chunks under 64K. */
|
||||
if (n < (0x10000 >> GRUB_MM_ALIGN_LOG2)
|
||||
|| *first == p)
|
||||
*first = q;
|
||||
|
||||
return p + 1;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user