示例#1
0
struct page *alloc_new(int n, struct page *next)
/* Assumes freepages_lock held */
{
  struct page *newp = region_get_mem(n << RPAGELOG);
  assert(newp);
  assert(!((long)newp & (RPAGESIZE - 1)));

  /* region_get_mem may get us more memory than we asked for */
  return alloc_split(newp, n, next);
}
示例#2
0
struct page* alloc_new(int n, struct page *next)
{
	/* Assumes freepages_lock held */
	struct page *newp = region_get_mem( (INT_PTR)n << RPAGELOG );

	if (!newp) {
		if (nomem_h)
			nomem_h();
		abort();
	}
	assert( !( (long)newp & (RPAGESIZE - 1) ) );
	/*newp->list_id = Hash(pthread_self())%MAXLISTS;*/
	newp->list_id = list_id % MAXLISTS;
	/* region_get_mem may get us more memory than we asked for */
	return alloc_split(newp, n, next);
}