• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /barrelfish-2018-10-04/usr/eclipseclp/Shm/src/

Lines Matching refs:pages

124  * Management of free pages:
126 * We maintain a bitmap pages->map[] of all memory pages.
129 * Additionally, we have free lists pages->free[] for page clusters.
130 * pages->free[i] holds a list of i-page cluster descriptor.
131 * pages->free[0] holds a list of clusters of size PAGE_LISTS or larger.
147 * not be in the pages themselves, that causes unnecessary page accesses.
173 if (! pages->map[Block]) \
174 pages->map[Block] = _new_bitmap_block(hd); \
175 Ptr = &(pages->map[Block][MapWord(i)]); \
186 if (! pages->map[block]) \
187 pages->map[block] = _new_bitmap_block(hd);\
188 ptr = pages->map[block]; \
200 if (! pages->map[block]) \
201 pages->map[block] = _new_bitmap_block(hd);\
202 ptr = pages->map[block] - 1 + \
215 struct page_admin *pages = hd->pages;
216 pages->min_addr = pages->max_addr = 0;
218 pages->map[i] = (bits32 *) 0;
220 pages->free[i] = (struct cluster *) 0;
221 pages->allocated = 0;
222 pages->freed = 0;
223 pages->log_page = (struct page_log *) 0;
224 pages->log_idx = 0;
238 ++hd->pages->allocated;
246 --hd->pages->allocated;
258 if (hd->pages->map[i])
260 _release_aux_page(hd, hd->pages->map[i]);
261 hd->pages->map[i] = 0;
264 if (hd->pages->allocated)
266 _print("SHM: not all pages were freed in pagemanager_fini()\n");
289 ((struct cluster *)ptr)->next = hd->pages->free[list_index];
292 hd->pages->free[list_index] = (struct cluster *)ptr;
301 p = &hd->pages->free[number_of_pages < PAGE_LISTS ? number_of_pages : 0];
323 if (ptr < hd->pages->min_addr ||
324 ((generic_ptr)((char*) ptr + size) > hd->pages->max_addr && hd->pages->max_addr))
342 struct page_admin *pages = hd->pages;
345 fprintf(stderr, "free %d pages\n", number_of_pages);
357 pages->freed += number_of_pages;
409 struct page_admin *pages = hd->pages;
412 fprintf(stderr, "free %d pages\n", number_of_pages);
424 pages->freed += number_of_pages;
428 for (clu = hd->pages->free[i]; clu; clu = next)
466 * when the heap is finalised. We use auxiliary pages for this log.
472 struct page_log *log_page = hd->pages->log_page;
479 int i = hd->pages->log_idx;
489 hd->pages->log_idx = i;
497 hd->pages->log_page = (struct page_log*) _alloc_aux_page(hd);
498 hd->pages->log_idx = 1;
499 hd->pages->log_page[0].addr = log_page; /* link to previous */
500 hd->pages->log_page[0].npages = 0;
501 hd->pages->log_page[1].addr = address;
502 hd->pages->log_page[1].npages = pages_requested;
510 struct page_log *log_page = hd->pages->log_page;
511 int max = hd->pages->log_idx;
520 hd->pages->allocated -= log_page[i].npages;
532 * Allocate memory in units of pages. The second argument returns the
550 struct page_admin *pages = hd->pages;
556 fprintf(stderr, "alloc %d pages\n", pages_needed);
561 if (pages->free[pages_needed]) /* a cluster that fits exactly */
563 pages->freed -= pages_needed;
564 cluster = pages->free[pages_needed];
565 pages->free[pages_needed] = cluster->next; /* remove from free list */
578 cluster_list = &pages->free[0]; /* try default list first */
584 if (pages->free[list_index]) /* found one */
586 cluster_list = &pages->free[list_index];
594 cluster_list = &pages->free[0];
605 pages->freed -= pages_needed;
660 pages->allocated += pages_requested;
662 if (!pages->min_addr || address < pages->min_addr)
663 pages->min_addr = address;
664 if (!pages->min_addr ||
665 (generic_ptr)((char*)address + bytes_requested) > pages->max_addr)
666 pages->max_addr = (generic_ptr)((char*)address + bytes_requested);
668 /* put excess pages in the free list */
987 #define FullyUsedPages(hd) (hd->pages->allocated - hd->pages->freed \
996 return hd->pages->allocated * BYTES_PER_PAGE;
1016 struct page_admin *pages = hd->pages;
1043 p_fprintf(current_err_, " = %d small pages + %d power pages\n",
1050 for (j=0, cl = pages->free[i]; cl; cl = cl->next, j++)
1055 for (cl = pages->free[0]; cl; cl = cl->next)
1065 hd->pages->allocated * BYTES_PER_PAGE);
1066 p_fprintf(current_err_, " pages = %d (%d small + %d power + %d whole + %d free)\n",
1067 pages->allocated, heap->small_block_pages, heap->power_pages,
1068 pages->allocated - heap->small_block_pages - heap->power_pages - pages->freed,
1069 pages->freed);