CHAPTER‐02‐DIAGRAM‐018‐OF‐026:‐FRACTAL‐MARK‐AND‐SWEEP‐SMALL‐ALLOCATION‐CASE - IronAutie/FractalClosedMemory GitHub Wiki

^^

^

<

>

case x ≤ SECTORS_PER_ROW  // x is number of sectors requested

    for each (p ∊ C.all_but_final_plane)
        for each (r ∊ all_but_final_row)
            s ← has_sectors (r, x)
            if s return s 
            s ← has_sectors (r, r.next_row, x)
            if s return s
            continue

        s ← has_sectors (p.final_row, x)
        if s return s 
        s ← has_sectors (p.final_row, p.next_plane.first_row, x)
        if s return s
        continue

    for each (r ∊ C.final_plane.all_but_final_row)
        s ← has_sectors (r, x)
        if s return s 
        s ← has_sectors (r, r.next_row, x)
        if s return s
        continue

    s ← has_sectors (C.final_plane.final_row, x)
    if s return s
    return ∅

Chapter 2 Fractal Mark & Sweep (c) Andrew Jonathan
Plate 18 of 26 SMALL ALLOCATION CASE Fine CC SA-BY-3.0