}
-int pow2(int i)
+unsigned long long pow2(int i)
{
- int x=1;
- for (;i>0;i--) { x*=2; }
+ unsigned long long x=1;
+ for (;i!=0;i--) { x*=2; }
return x;
}
WARNING("Allocating a memory pool smaller than the Palacios block size - may not be useful\n");
}
- if (pow2(get_order(r->num_pages)) != r->num_pages) {
- WARNING("Allocating a memory pool that is not a power of two - it will be rounded down!\n");
- r->num_pages=pow2(get_order(r->num_pages));
+ if (pow2(get_order(r->num_pages*PAGE_SIZE)) != r->num_pages*PAGE_SIZE) {
+ WARNING("Allocating a memory pool that is not a power of two (is %llu) - it will be rounded down!\n", r->num_pages*PAGE_SIZE);
+ r->num_pages=pow2(get_order(r->num_pages*PAGE_SIZE));
+ WARNING("Rounded power Allocating a memory pool that is not a power of two (rounded to %llu)\n", r->num_pages*PAGE_SIZE);
}