X-Git-Url: http://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=ccan%2Falloc%2Falloc.c;h=8e0b72aa0432227990f7b053f6620020fd53dcac;hp=b4235d0ef404b3fba2c7e3738a89832ad4be4286;hb=3d9899b97bff2a3ec5abe57f06c2a9355a18e6b5;hpb=bbd7380019f3ea4629d170af24b902bf734c83ea diff --git a/ccan/alloc/alloc.c b/ccan/alloc/alloc.c index b4235d0e..8e0b72aa 100644 --- a/ccan/alloc/alloc.c +++ b/ccan/alloc/alloc.c @@ -509,49 +509,6 @@ static u16 get_small_page(struct header *head, unsigned long poolsize, return ret; } -void where_is_page(struct header *head, struct page_header *where, - unsigned int sp_bits) -{ - struct page_header *pg; - unsigned long off, bucket, - num_buckets = max_bucket(sp_bits + BITS_FROM_SMALL_TO_LARGE_PAGE); - - for (off = head->small_free_list; off; off = pg->next) { - pg = from_pgnum(head, off, sp_bits); - if (pg == where) { - printf("It's in the small free list\n"); - return; - } - } - - for (off = head->large_free_list; off; off = pg->next) { - pg = from_pgnum(head, off, sp_bits); - if (pg == where) { - printf("It's in the large free list\n"); - return; - } - } - - for (bucket = 0; bucket < num_buckets; bucket++) { - for (off = head->bs[bucket].page_list; off; off = pg->next) { - pg = from_pgnum(head, off, sp_bits); - if (pg == where) { - printf("It's in %lu bucket page list\n", bucket); - return; - } - } - - for (off = head->bs[bucket].full_list; off; off = pg->next) { - pg = from_pgnum(head, off, sp_bits); - if (pg == where) { - printf("It's in %lu bucket full list\n", bucket); - return; - } - } - } - printf("It's nowhere!\n"); -} - static bool huge_allocated(struct header *head, unsigned long offset) { unsigned long i;