Author: Remi Meier <[email protected]>
Branch: c8-faster-smallobj-sync
Changeset: r1959:7c57425824e9
Date: 2015-09-15 09:52 +0200
http://bitbucket.org/pypy/stmgc/changeset/7c57425824e9/
Log: Merge with use-gcc
diff --git a/c8/TODO b/c8/TODO
--- a/c8/TODO
+++ b/c8/TODO
@@ -1,3 +1,10 @@
+- stm_identityhash spends a good time figuring out if an obj is prebuilt
+ (40% of its time). maybe after setup_prebuilt, we could defer the test
+ of GCFLAG_HAS_SHADOW in id_or_identityhash to after an address comparison.
+ I.e., after setup_prebuilt, all objs allocated there could be in some
+ area at the start of the heap, and can thus be classified by having
+ an address < some_barrier. (may include some non-prebuilt ones, but
+ that's ok) (also take care of small prebuilt objs)
- fix markers (e.g. become_inevitable doesn't seem to show up)
diff --git a/c8/stm/nursery.c b/c8/stm/nursery.c
--- a/c8/stm/nursery.c
+++ b/c8/stm/nursery.c
@@ -794,8 +794,16 @@
char *realobj = REAL_ADDRESS(STM_SEGMENT->segment_base, obj);
size_t size = stmcb_size_rounded_up((struct object_s *)realobj);
- /* always gets outside as a large object for now (XXX?) */
- object_t *nobj = (object_t *)allocate_outside_nursery_large(size);
+ /* always gets outside */
+ object_t *nobj;
+ if (size > GC_LAST_SMALL_SIZE) {
+ /* case 1: object is not small enough.
+ Ask gcpage.c for an allocation via largemalloc. */
+ nobj = (object_t *)allocate_outside_nursery_large(size);
+ } else {
+ /* case "small enough" */
+ nobj = (object_t *)allocate_outside_nursery_small(size);
+ }
/* Initialize the shadow enough to be considered a valid gc object.
If the original object stays alive at the next minor collection,
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit