Changes between Version 8 and Version 9 of GCMassacre

Show
Ignore:
Timestamp:
05/26/10 12:23:14 (12 years ago)
Author:
bacek
Comment:

Add note about using "PMC_Allocator" as "Allocator"

Legend:

Unmodified
Added
Removed
Modified
  • GCMassacre

    v8 v9  
    420420 
    421421}}} 
     422 
     423== Rename and extend current "PMC_Allocator" == 
     424 
     425Current PMC_Allocator is pretty fast, well tested and (almost) suitable to be described {{{Allocator}}}. We just have to implement {{{Allocator.is_owned}}} method. Design of {{{PMC_Allocator}}} isn't "tuned" for such usecase, but it should be fine because {{{.is_owned}}} called only during tracing system stack. 
     426 
     427Roughly implmentation of {{{.is_owned}}} will be this: 
     428{{{ 
     429#!perl 
     430PMC_Allocator.is_owned($obj) { 
     431    my $arena = self.top_arena; 
     432    while $arena { 
     433       return Bool::True if ptr_diff($arena, $obj) < 4096; 
     434       $arena = $arena.prev; 
     435    } 
     436    return Bool::False; 
     437} 
     438 
     439}}}