int finalnodes, finalpages;
int largest;
+#if NONCONTIGUOUS
+ /* If NONCONTIGUOUS is on, allocate physical pages single
+ * pages at a time, accomplished by returning single pages
+ * if the caller can handle that (indicated by PAF_FIRSTBLOCK).
+ */
+ if(memflags & PAF_FIRSTBLOCK) {
+ assert(!(memflags & PAF_CONTIG));
+ pages = 1;
+ }
+#endif
+
memstats(&firstnodes, &firstpages, &largest);
sanitycheck();
wantnodes = firstnodes;
incr = 0;
}
-#if NONCONTIGUOUS
- /* If NONCONTIGUOUS is on, allocate physical pages single
- * pages at a time, accomplished by returning single pages
- * if the caller can handle that (indicated by PAF_FIRSTBLOCK).
- */
- if(memflags & PAF_FIRSTBLOCK) {
- assert(!(memflags & PAF_CONTIG));
- pages = 1;
- }
-#endif
-
while((pr = addr_get_iter(&iter))) {
SLABSANE(pr);
assert(pr->size > 0);
ml->phys = CLICK2ABS(mem);
ml->length = CLICK2ABS(gotpages);
ml->next = NULL;);
- if(tail)
- tail->next = ml;
+ if(tail) {
+ USE(tail,
+ tail->next = ml;);
+ }
tail = ml;
if(!head)
head = ml;