Skip to content

MPS_KEY_GEN for AMC allocation points #313

@ellerh

Description

@ellerh

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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions