Author: Remi Meier <[email protected]>
Branch: use-gcc
Changeset: r1938:8a3e95080098
Date: 2015-08-17 16:24 +0200
http://bitbucket.org/pypy/stmgc/changeset/8a3e95080098/
Log: renaming for clarity
diff --git a/c8/stm/smallmalloc.c b/c8/stm/smallmalloc.c
--- a/c8/stm/smallmalloc.c
+++ b/c8/stm/smallmalloc.c
@@ -8,9 +8,9 @@
typedef struct {
uint8_t sz;
-} fpsz_t;
+} full_page_size_t;
-static fpsz_t full_pages_object_size[PAGE_SMSIZE_END - PAGE_SMSIZE_START];
+static full_page_size_t full_pages_object_size[PAGE_SMSIZE_END -
PAGE_SMSIZE_START];
/* ^^^ This array contains the size (in number of words) of the objects
in the given page, provided it's a "full page of small objects". It
is 0 if it's not such a page, if it's fully free, or if it's in
@@ -19,7 +19,7 @@
technically full yet, it will be very soon in this case).
*/
-static fpsz_t *get_fpsz(char *smallpage)
+static full_page_size_t *get_full_page_size(char *smallpage)
{
uintptr_t pagenum = (((char *)smallpage) - END_NURSERY_PAGE * 4096UL -
stm_object_pages) / 4096;
/* <= PAGE_SMSIZE_END because we may ask for it when there is no
@@ -118,7 +118,7 @@
/* Succeeded: we have a page in 'smallpage' */
*fl = smallpage->next;
- get_fpsz((char *)smallpage)->sz = n;
+ get_full_page_size((char *)smallpage)->sz = n;
return (char *)smallpage;
}
@@ -156,7 +156,7 @@
*previous = NULL;
/* The first slot is immediately returned */
- get_fpsz((char *)smallpage)->sz = n;
+ get_full_page_size((char *)smallpage)->sz = n;
return (char *)smallpage;
}
@@ -300,6 +300,7 @@
any_object_remaining = true;
}
}
+
if (!any_object_remaining) {
/* give page back to free_uniform_pages and thus make it
inaccessible from all other segments again (except seg0) */
@@ -316,7 +317,9 @@
increment_total_allocated(-4096);
}
else if (!any_object_dying) {
- get_fpsz(baseptr)->sz = szword;
+ /* this is still a full page. only in this case we set the
+ full_page_size again: */
+ get_full_page_size(baseptr)->sz = szword;
}
else {
check_order_inside_small_page(page_free);
@@ -342,9 +345,9 @@
if (*fl != NULL) {
/* the entry in full_pages_object_size[] should already be
szword. We reset it to 0. */
- fpsz_t *fpsz = get_fpsz((char *)*fl);
- assert(fpsz->sz == szword);
- fpsz->sz = 0;
+ full_page_size_t *full_page_size = get_full_page_size((char
*)*fl);
+ assert(full_page_size->sz == szword);
+ full_page_size->sz = 0;
sweep_small_page(getbaseptr(*fl), *fl, szword);
*fl = NULL;
}
@@ -354,7 +357,7 @@
while (page != NULL) {
/* for every page in small_page_lists: assert that the
corresponding full_pages_object_size[] entry is 0 */
- assert(get_fpsz((char *)page)->sz == 0);
+ assert(get_full_page_size((char *)page)->sz == 0);
nextpage = page->nextpage;
sweep_small_page(getbaseptr(page), page, szword);
page = nextpage;
@@ -364,10 +367,10 @@
/* process the really full pages, which are the ones which still
have a non-zero full_pages_object_size[] entry */
char *pageptr = uninitialized_page_stop;
- fpsz_t *fpsz_start = get_fpsz(pageptr);
- fpsz_t *fpsz_end = &full_pages_object_size[PAGE_SMSIZE_END -
- PAGE_SMSIZE_START];
- fpsz_t *fpsz;
+ full_page_size_t *fpsz_start = get_full_page_size(pageptr);
+ full_page_size_t *fpsz_end = &full_pages_object_size[PAGE_SMSIZE_END -
+ PAGE_SMSIZE_START];
+ full_page_size_t *fpsz;
for (fpsz = fpsz_start; fpsz < fpsz_end; fpsz++, pageptr += 4096) {
uint8_t sz = fpsz->sz;
if (sz != 0) {
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit