mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-02 12:20:51 +00:00
Fix the real problem that broke the Alpha loader this last week. It
was not the fault of the module code, nor FICL. The malloc code requires sbrk() to return addresses that were at least 16 byte aligned. If the Alpha loader happened to be 8 byte but not 16 byte aligned in length, then you would get a zfree() panic at startup. Incidently, this affected the i386 loader as well, and explains why the static heap changed things and why jlemon had trouble when the bss was not ending at a multiple of 8 bytes. My fix is to 16 byte align it on all arches, even though the x86 version only required 8 byte alignment (struct MemNode is smaller there). We could page align it if we wanted to be paranoid, but it isn't presently necessary.
This commit is contained in:
parent
4887dfcfd4
commit
c536ef83f0
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=60481
@ -39,8 +39,9 @@ static void *heapbase;
|
||||
void
|
||||
setheap(void *base, void *top)
|
||||
{
|
||||
heapbase = base;
|
||||
maxheap = top - base;
|
||||
/* Align start address to 16 bytes for the malloc code. Sigh. */
|
||||
heapbase = (void *)(((uintptr_t)base + 15) & ~15);
|
||||
maxheap = top - heapbase;
|
||||
}
|
||||
|
||||
char *
|
||||
|
Loading…
Reference in New Issue
Block a user