amd64 fixes
This commit is contained in:
@ -20,7 +20,7 @@ static Block*
|
||||
_allocb(int size)
|
||||
{
|
||||
Block *b;
|
||||
ulong addr;
|
||||
uintptr addr;
|
||||
|
||||
if((b = mallocz(sizeof(Block)+size+Hdrspc, 0)) == nil)
|
||||
return nil;
|
||||
@ -31,13 +31,13 @@ _allocb(int size)
|
||||
b->flag = 0;
|
||||
|
||||
/* align start of data portion by rounding up */
|
||||
addr = (ulong)b;
|
||||
addr = (uintptr)b;
|
||||
addr = ROUND(addr + sizeof(Block), BLOCKALIGN);
|
||||
b->base = (uchar*)addr;
|
||||
|
||||
/* align end of data portion by rounding down */
|
||||
b->lim = ((uchar*)b) + sizeof(Block)+size+Hdrspc;
|
||||
addr = (ulong)(b->lim);
|
||||
addr = (uintptr)(b->lim);
|
||||
addr = addr & ~(BLOCKALIGN-1);
|
||||
b->lim = (uchar*)addr;
|
||||
|
||||
@ -60,7 +60,7 @@ allocb(int size)
|
||||
* Can still error out of here, though.
|
||||
*/
|
||||
if(up == nil)
|
||||
panic("allocb without up: %luX\n", getcallerpc(&size));
|
||||
panic("allocb without up: %p\n", getcallerpc(&size));
|
||||
if((b = _allocb(size)) == nil){
|
||||
panic("allocb: no memory for %d bytes\n", size);
|
||||
}
|
||||
|
Reference in New Issue
Block a user