plan 9 kernel history: overview | file list | diff list

1992/0622/port/alloc.c (diff list | history)

1992/0621/sys/src/9/port/alloc.c:73,931992/0622/sys/src/9/port/alloc.c:73,78 (short | long | prev | next)
1992/0619    
static Arena	arena; 
static Xalloc	xlists; 
 
void* 
ialloc(ulong size, int align) 
{ 
	ulong p; 
                 
	if(align) { 
		size += BY2PG; 
		p = (ulong)xalloc(size); 
		p += BY2PG; 
		p &= ~(BY2PG-1); 
		return (void*)p; 
	} 
1992/0621    
	return xalloc(size);; 
1992/0619    
} 
                 
1992/0618    
void 
xinit(void) 
{ 
1992/0621/sys/src/9/port/alloc.c:305,3121992/0622/sys/src/9/port/alloc.c:290,300
1992/0619    
	void *p; 
 
	p = malloc(size); 
	if(p == nil) 
1992/0622    
	if(p == nil) { 
		print("asking for %d\n", size); 
		xsummary(); 
1992/0619    
		panic("smalloc should sleep"); 
1992/0622    
	} 
1992/0619    
	return p; 
} 
 


source code copyright © 1990-2005 Lucent Technologies; see license
Plan 9 distribution
comments to russ cox (rsc@swtch.com)