Heise reports from SCO Forum
Posted Aug 19, 2003 15:30 UTC (Tue) by
rfunk (subscriber, #4054)
In reply to:
Heise reports from SCO Forum by rfunk
Parent article:
Heise reports from SCO Forum
As it appears in the Lions book:
/*
* Allocate size units from the given
* map. Return the base of the allocated
* space.
* Algorithm is first fit.
*/
malloc(mp, size)
struct map *mp;
{
register int a;
register struct map *bp;
for (bp = mp; bp->m_size; bp++) {
if (bp->m_size >= size) {
a = bp->m_addr;
bp->m_addr =+ size;
if ((bp->m_size =- size) == 0)
do {
bp++;
(bp-1)->m_addr = bp->m_addr;
while((bp-1)->m_size = bp->m_size);
return(a);
}
}
return(0);
}
(
Log in to post comments)