-
Notifications
You must be signed in to change notification settings - Fork 85
Open
Description
Sometimes it would be useful to allocate in an old generation.
What would you think of supporting MPS_KEY_GEN when creating allocation points for the AMC pool, like in the patch below?
--- a/mps/code/poolamc.c
+++ b/mps/code/poolamc.c
@@ -519,8 +519,13 @@ #define amcKeyAPHashArrays (&_mps_key_ap_hash_arrays)
amcbuf = CouldBeA(amcBuf, buffer);
if (BufferIsMutator(buffer)) {
- /* Set up the buffer to be allocating in the nursery. */
- amcbuf->gen = amc->nursery;
+ if (ArgPick(&arg, args, MPS_KEY_GEN)) {
+ unsigned gen = arg.val.u;
+ amcbuf->gen = amc->gen[gen];
+ } else {
+ /* Set up the buffer to be allocating in the nursery. */
+ amcbuf->gen = amc->nursery;
+ }
} else {
/* No gen yet -- see <design/poolamc#.gen.forward>. */
amcbuf->gen = NULL;
--
Metadata
Metadata
Assignees
Labels
No labels