1# Copyright (C) 2001-2010, Parrot Foundation.
2
3=head1 PDD 9: Garbage Collection Subsystem
4
5=head2 Abstract
6
7This PDD specifies Parrot's garbage collection and memory management
8subsystems.
9
10=head2 Definitions
11
12=head3 Garbage collection (GC)
13
14Garbage collection is a process of freeing up memory that is no longer used by
15the interpreter, by determining which objects will not be referenced again and
16can be reclaimed.
17
18=head3 Mark and sweep (MS)
19
20Starting from a known root set, the GC traces all reachable memory objects by
21following pointers. Objects reached in this way, and therefore visible for
22use by the program, are alive. Objects which are not reached in the trace are
23marked dead. In the second stage, sweep, all dead objects are destroyed and
24reclaimed.
25
26=head3 Tri-color mark and sweep
27
28Instead of a simple separation of marked (as live) and unmarked (dead), the
29object set is divided into three parts: white, gray, and black. The white
30objects are presumed dead. The gray objects have been marked as live by some
31other object, but haven't yet marked the objects they refer to. The black
32objects are live, and have marked all objects they directly refer to.
33
34In the initial run, all objects start as white and the root set is marked
35gray.  The marking process changes white objects to gray (marking them from
36another gray object), and gray objects to black (when all objects they refer
37to are marked). When the gray set is empty, all live objects have been marked
38and the white set can be collected. After a collection run, all black objects
39are reset to white, the root set to gray, and the process begins again.
40
41The advantage of a tri-color mark over a simple mark is that it can be broken
42into smaller stages.
43
44=head3 Copying collection
45
46A copying GC copies objects from one memory region to another during the mark
47phase. At the end of the mark, all memory in the old region is dead and the
48whole region can be reclaimed at once.
49
50=head3 Compacting collection
51
52The compacting GC moves live objects close together in a single region in
53memory. This helps to elimianate fragmented free space and allows the
54allocation of large live objects. Compacting and copying collectors are often
55similar or even identical in implementation.
56
57=head3 Uncooperative
58
59An uncooperative GC is implemented as a separate module, often without
60affecting the remainder of the program. The programmer can write software
61without needing to be aware of the operations or implementation of the GC.
62The alternative is a cooperative GC, which is often implemented as a reference
63counting scheme and requires GC-related logic to be dispersed throughout the
64entire program.
65
66=head3 Stop-the-world
67
68A common disadvantage of a simple mark implementation is that the entire
69system (including all threads that use the same memory pools) must be
70suspended while the whole memory set is examined during marking and
71collection.  Normal operation continues only after the whole GC cycle is
72performed. This can lead to arbitrarily long pauses during program execution.
73
74=head3 Incremental
75
76In order to alleviate the arbitrarily long pauses in a stop-the-world GC, the
77incremental GC breaks the mark and sweep process up into smaller, shorter
78phases. Each GC phase may still require the entire program to pause, but the
79pauses are shorter and more frequent.
80
81=head3 Real-time
82
83The pauses caused by GC don't exceed a certain limit.
84
85=head3 Generational
86
87The object space is divided between a young generation (short-lived
88temporaries) and one or more old generations. Only young generations are reset
89to white (presumed dead). The older generations are scanned less often because
90it is assumed that long-lived objects tend to live longer.
91
92=head3 Concurrent
93
94GC marking and collection runs as a separate thread, sometimes with multiple
95threads participating in GC. On a multi-processor machine, concurrent GC may
96be truly parallel.
97
98=head3 Conservative
99
100A conservative GC traces through memory looking for pointers to living
101objects. The GC does not necessarily have information about the layout of
102memory, so it cannot differentiate between an actual pointer and an integral
103value which has the characteristics of a pointer. The Conservative GC follows
104a policy of "no false negatives" and traces any value which appears to be a
105pointer.
106
107=head3 Precise
108
109A precise GC has intimate knowledge of the memory layout of the system and
110knows where to find pointers. In this way the precise collector never has
111any false positives.
112
113=head2 Synopsis
114
115Not applicable.
116
117=head2 Description
118
119No GC algorithm is ideal for all workloads. To support multiple workloads,
120Parrot provides support for pluggable uncooperative GC cores. Parrot will
121attempt to provide a default core which has reasonable performance for most
122programs. Parrot provides no built-in support for cooperative GCs.
123
124Parrot uses two separate memory allocation mechanisms: a fixed-size system for
125small objects of fixed size (PMC and STRING headers, etc), and a buffer
126allocator for arbitrary-sized objects, such as string contents. The default
127fixed-size memory allocator uses a SLAB-like algorithm to allocate objects
128from large pre-allocated pools. The default buffer allocator uses a compacting
129algorithm.
130
131=head2 Implementation
132
133Parrot supports pluggable garbage collection cores, so ultimately any
134uncooperative garbage collection model devised can run on it.
135
136Parrot really has two independent GC models, one used for objects (PMCs) and
137the other used for buffers (including strings). The core difference is that
138buffers cannot contain other buffers, so incremental marking is unnecessary.
139
140=head3 Terminology
141
142A GC run is composed of two distinct operations: Finding objects which are
143dead (the "trace" or "mark" phase) and freeing dead objects for later reuse
144(the "sweep" phase). The sweep phase is also known as the collection phase.
145The trace phase is less frequently known as the "dead object detection" phase.
146
147=head3 Marking
148
149Each PMC and STRING has a C<flags> member which is a bitfield of various
150flags. Three flags in particular are important for GC operation.
151C<PObj_live_FLAG> is set if the object is currently alive and active.
152C<PObj_on_free_list_FLAG> is set if the object is currently on the free list
153and is available for reallocation. A third flag, C<PObj_grey_FLAG> can be used
154to support tricolor mark. Despite the given names of these flags, they can be
155used by the active GC core for almost any purpose, or they can be ignored
156entirely if the GC provides another mechanism for marking the various life
157stages of the object. These flags are typically not used outside the GC
158subsystem.
159
160=head4 Special PMCs
161
162=head4 Root Set
163
164The root set for the GC mark is the interpreter object and, if necessary,
165the C system stack. If the C system stack is traced, the GC is conservative.
166
167=head4 Initiating a mark and sweep
168
169Depending on the core in use, the mark and sweep phases may be initiated in
170different ways. A concurrent core would always be running in the background.
171The most common mechanism for a non-concurrent core is to initiate a run of
172the GC system when an attempt is made to allocate
173
174=head4 Object marking
175
176To mark a PMC, the C<Parrot_gc_mark_pmc_alive> function is called. To mark a
177STRING, the C<Parrot_gc_mark_string_alive> function is called. These functions
178mark the object alive, typically by setting the C<PObj_live_FLAG> flag.
179
180If the PMC contains references to other PMCs and STRINGS, it must have the
181C<PObj_custom_mark_FLAG> flag set. If this flag is set, the C<mark> VTABLE
182for that PMC is called to mark the pointers in that PMC. The custom_mark flag
183is ignored in STRINGs.
184
185=head4 Buffer Marking
186
187Buffers are always attached to a fixed-size header, or several headers. During
188the mark phase of the fixed-size objects, owned buffers are flagged as alive.
189At somet time after the fixed-size objects are marked, the buffer pool is
190compacted by moving all alive buffers to a new pool and then freeing the old
191pool back to the operating system.
192
193=head3 Collection
194
195When all objects have been marked, the collection phase begins.
196
197=head4 Collecting objects
198
199During the sweep phase, objects which had previously been alive but were not
200traced in the most recent mark phase are dead and are collected. If the
201C<PObj_custom_destroy_FLAG> is set on a PMC, the GC will call the C<destroy>
202VTABLE on that PMC to do custom cleanup. This flag is ignored in STRINGs.
203
204The GC does not collect dead PMCs in any particular order and does not
205guarantee any ordering of collection between dependent PMCs. Some GC cores may
206enforce some ordering or dependency recognition, but this is not guaranteed.
207
208=head3 Finalization
209
210When the interpreter object is destroyed, the GC system is finalized. During
211finalization, all living PMCs in the system are destroyed unconditionally and
212all memory owned by the interpreter is freed back to the operating system.
213
214=head3 Internal Structures
215
216A GC core is defined in memory by a structure of function pointers to various
217routines that perform the primitive operations of the GC. A GC core must
218define most of the pointers in the C<< interp->gc_sys >> structure, which is
219a C<GC_Subsystem> structure.
220
221C<GC_Subsystem> has the following fields:
222
223=over 4
224
225=item C<void (*finalize_gc_system) (PARROT_INTERP)>
226
227Function to finalize the GC system, by freeing all PMCs and returning all
228allocated memory to the operating system.
229
230=item C<void (*destroy_child_interp)(Interp *dest_interp,
231Interp *child_interp)>
232
233=item C<void (*do_gc_mark)(PARROT_INTERP, UINTVAL flags)>
234
235Perform a GC mark and sweep run, or at least run a single increment of it.
236
237=item C<void (*compact_string_pool)(PARROT_INTERP)>
238
239Compact the string pool and destroy all unused buffers.
240
241=item C<void (*mark_special)(PARROT_INTERP, PMC *)>
242
243Mark a special PMC. A PMC is special if it has the C<PObj_is_special_FLAG>
244flag set.
245
246=item C<void (*pmc_needs_early_collection)(PARROT_INTERP, PMC *)>
247
248Flag a PMC as needing early collection.
249
250=item C<void (*init_pool)(PARROT_INTERP, struct Fixed_Size_Pool *)>
251
252Initialize a new memory pool.
253
254=item C<PMC* (*allocate_pmc_header)(PARROT_INTERP, UINTVAL flags)>
255
256Allocate a new PMC object from the system.
257
258=item C<void (*free_pmc_header)(PARROT_INTERP, PMC *)>
259
260Free a PMC object back to the system.
261
262=item C<STRING* (*allocate_string_header)(PARROT_INTERP, UINTVAL flags)>
263
264Allocate a new STRING header from the system.
265
266=item C<void (*free_string_header)(PARROT_INTERP, STRING*)>
267
268Free a STRING object back to the system.
269
270=item C<Buffer* (*allocate_bufferlike_header)(PARROT_INTERP, size_t size)>
271
272=item C<void (*free_bufferlike_header)(PARROT_INTERP, Buffer*, size_t size)>
273
274=item C<int  (*is_pmc_ptr)(PARROT_INTERP, void*)>
275
276Determine if the given pointer is or resembles a valid PMC pointer.
277
278=item C<int  (*is_string_ptr)(PARROT_INTERP, void*)>
279
280Determine if the given pointer is or resembles a valid STRING pointer.
281
282=item C<void (*mark_pobj_header)(PARROT_INTERP, PObj*)>
283
284=item C<void (*mark_pmc_header)(PARROT_INTERP, PMC *)>
285
286Mark a PMC alive.
287
288=item C<void* (*allocate_pmc_attributes)(PARROT_INTERP, PMC *)>
289
290Allocate attribute storage for a PMC. The size of the attributes structure is
291determined from the PMCs VTABLE.
292
293=item C<void (*free_pmc_attributes)(PARROT_INTERP, PMC *)>
294
295Free an attribute structure back to the system.
296
297=item C<void (*allocate_string_storage)
298(PARROT_INTERP, STRING *str, size_t size)>
299
300Allocate buffer storage for a string.
301
302=item C<void (*reallocate_string_storage)
303(PARROT_INTERP, STRING *str, size_t size)>
304
305Resize existing string storage to fit data of the new size.
306
307=item C<void (*allocate_buffer_storage)
308(PARROT_INTERP, ARGMOD(Buffer *buffer), size_t nsize)>
309
310Allocate buffer storage for any purpose.
311
312=item C<void (*reallocate_buffer_storage)
313(PARROT_INTERP, ARGMOD(Buffer *buffer), size_t newsize)>
314
315Reallocate or resize existing buffer storage.
316
317=item C<void* (*allocate_fixed_size_storage)(PARROT_INTERP, size_t size)>
318
319Allocate storage for a fixed-size header which is not a PMC or a STRING. The
320contents of this structure are not marked automatically by GC.
321
322=item C<void (*free_fixed_size_storage)(PARROT_INTERP, size_t size, void *)>
323
324Free a fixed-size structure back to the system.
325
326=item C<void* (*allocate_memory_chunk)(PARROT_INTERP, size_t size)>
327
328=item C<void* (*reallocate_memory_chunk)(PARROT_INTERP, void *data,
329size_t newsize)>
330
331=item C<void* (*allocate_memory_chunk_with_interior_pointers)(PARROT_INTERP,
332size_t size)>
333
334=item C<void* (*reallocate_memory_chunk_with_interior_pointers)(PARROT_INTERP,
335void *data, size_t oldsize, size_t newsize)>
336
337=item C<void (*free_memory_chunk)(PARROT_INTERP, void *data)>
338
339=item C<void (*block_mark)(PARROT_INTERP)>
340
341Block the GC mark from occurring.
342
343=item C<void (*unblock_mark)(PARROT_INTERP)>
344
345Unblock the GC mark.
346
347=item C<unsigned int (*is_blocked_mark)(PARROT_INTERP)>
348
349Query the blocked state of the GC mark.
350
351=item C<void (*block_sweep)(PARROT_INTERP)>
352
353Block the GC sweep phase.
354
355=item C<void (*unblock_sweep)(PARROT_INTERP)>
356
357Unblock the GC sweep phase.
358
359=item C<unsigned int (*is_blocked_sweep)(PARROT_INTERP)>
360
361Query the blocked state of the GC sweep.
362
363=item C<size_t (*get_gc_info)(PARROT_INTERP, Interpinfo_enum)>
364
365Query information about the GC core.
366
367=back
368
369=head4 The Memory_Pools structure
370
371The C<Memory_Pools> structure contains pointers to a variety of memory pools,
372each used for a specific purpose. Two are Var_Size_Pool pointers (memory_pool,
373constant_string_pool), and six are Fixed_Size_Pool structures (pmc_pool,
374constant_pmc_pool, constant_string_header_pool).
375
376The C<Memory_Pools> structure holds function pointers for the core defined
377interface of the currently active GC subsystem: C<init_pool>, C<do_gc_mark>,
378C<finalize_gc_system>. It holds various accounting information for the GC
379subsystem, including how many GC runs have been completed, amount of memory
380allocated since the last run, and total memory allocated. This accounting
381information is updated by the GC system. The current block level for GC mark
382and sweep phases is stored in the C<Memory_Pools> structure.
383(See L<Blocking GC>.)
384
385The pointer C<void *gc_private> is reserved for use by the currently active GC
386subsystem (with freedom for variation between GC implementations).
387
388=head4 The Var_Size_Pool structure
389
390The C<Var_Size_Pool> structure is a simple memory pool. It contains a pointer
391to the top block of the allocated pool, the total allocated size of the pool,
392the block size, and some details on the reclamation characteristics of the
393pool.
394
395=head4 The Fixed_Size_Pool structure
396
397The C<Fixed_Size_Pool> structure is a richer memory pool for object
398allocation. It tracks details like the number of allocated and free objects
399in the pool, a list of free objects, and for the generational GC
400implementation maintains linked lists of white, black, and gray PMCs. It
401contains a pointer to a simple C<Var_Size_Pool> (the base storage of the
402pool). It holds function pointers for adding and retrieving free objects in
403the pool, and for allocating objects.
404
405=head3 Internal API
406
407Each GC core provides a standard interface for interaction with the core.
408
409=head4 Initialization
410
411Each GC core declares an initialization routine as a function pointer,
412which is installed in F<src/memory.c:mem_setup_allocator()> after
413creating C<mem_pools> in the interpreter struct.
414
415=over 4
416
417=item C<void Parrot_gc_XXX_init(Interp *)>
418
419A routine to initialize the GC system named C<XXX>.
420
421The initialization code is responsible for the creation of the header pools
422and fills the function pointer slots in the interpreter's C<mem_pools>
423member.
424
425=back
426
427=head4 Memory_Pools structure function pointers
428
429Each GC system declares 3 function pointers, stored in the Memory_Pools
430structure.
431
432=over 4
433
434=item C<void (*init_gc_system) (Interp *)>
435
436Initialize the GC system. Install the additional function pointers into
437the Memory_Pools structure, and prepare any private storage to be used by
438the GC in the Memory_Pools->gc_private field.
439
440=item C<void (*do_gc_mark) (Interp *, int flags)>
441
442Trigger or perform a GC run. With an incremental GC core, this may only
443start/continue a partial mark phase or sweep phase, rather than performing an
444entire run from start to finish. It may take several calls to C<do_gc_mark> in
445order to complete an entire run of an incremental collector.
446
447For a concurrent collector, calls to this function may activate a concurrent
448collection thread or, if such a thread is already running, do nothing at all.
449
450The C<do_gc_mark> function is called from the C<Parrot_gc_mark_and_sweep>
451function, and should not usually be called directly.
452
453C<flags> is one of:
454
455=over 4
456
457=item C<0>
458
459Run the GC normally, including the trace and the sweep phases, if applicable.
460Incremental GCs will likely only run one portion of the complete GC run, and
461repeated calls would be required for a complete run. A complete trace of all
462system areas is not required.
463
464=item GC_trace_normal | GC_trace_stack_FLAG
465
466Run a normal GC trace cycle, at least. This is typically called when there
467is a resource shortage in the buffer memory pools before the sweep phase is
468run. The processor registers and any other system areas have to be traced too.
469
470Behavior is determined by the GC implementation, and might or might not
471actually run a full GC cycle. If the system is an incremental GC, it might
472do nothing depending on the current state of the GC. In an incremental GC, if
473the GC is already past the trace phase it may opt to do nothing and return
474immediately. A copying collector may choose to run a mark phase if it hasn't
475yet, to prevent the unnecessary copying of dead objects later on.
476
477=item GC_lazy_FLAG
478
479Do a timely destruction run. The goal is either to detect all objects that
480need timely destruction or to do a full collection. This is called from the
481Parrot run-loop, typically when a lexical scope is exited and the local
482variables in that scope need to be cleaned up. Many types of PMC objects, such
483as line-buffered IO PMCs rely on this behavior for proper operation.
484
485No system areas have to be traced.
486
487=item GC_finish_FLAG
488
489Finalize and destroy all living PMCs. This is called during interpreter
490destruction. The GC subsystem must clear the live state of all objects
491and perform a sweep in the PMC header pool, so that destructors and finalizers
492get called. PMCs which have custom destructors rely on this behavior for
493proper operation.
494
495=back
496
497=item C<void (*finalize_gc_system) (Interp *)>
498
499Called during interpreter destruction. Free used resources and memory pools.
500All PMCs must be swept, and PMCs with custom destroy VTABLE functions must
501have those called.
502
503=item C<void (*init_pool) (Interp *, Fixed_Size_Pool *)>
504
505Initialize the given pool. Populates the C<Fixed_Size_Pool> structure with
506initial values, and sets a series of function pointers for working with the
507pool. The function pointers used with the pool are discussed next.
508
509=back
510
511=head4 Fixed_Size_Pool function pointers
512
513Each GC core defines 4 function pointers stored in the C<Fixed_Size_Pool>
514structures. These function pointers are used throughout Parrot to implement
515basic behaviors for the pool.
516
517=over 4
518
519=item C<PObj * (*get_free_object) (Interp *, Fixed_Size_Pool*)>
520
521Get a free object from the pool. This function returns one free object from
522the given pool and removes that object from the pool's free list. PObject
523flags are returned clear, except flags that are used by the garbage collector
524itself, if any. If the pool is a buffer header pool all other object memory
525is zeroed.
526
527=item C<void (*add_free_object) (Interp *, Fixed_Size_Pool *, PObj *);>
528
529Add a freed object to the pool's free list. This function is most often called
530internally to the GC itself to add items to the free list after a sweep, or
531when a new arena is created to add the new items to the free list. It does
532not need to be used in this way, however.
533
534=item C<void (*alloc_objects) (Interp *, Fixed_Size_Pool *);>
535
536Allocate a new arena of objects for the pool. Initialize the new arena and add
537all new objects to the pool's free list. Some collectors implement a growth
538factor which increases the size of each new allocated arena.
539
540=item C<void (*more_objects) (Interp *, Fixed_Size_Pool *);>
541
542Reallocation for additional objects. It has the same signature as
543C<alloc_objects>, and in some GC cores the same function pointer is used for
544both. In some GC cores, C<more_objects> may do a GC run in an attempt to free
545existing objects without having to allocate new ones. This function may also
546call C<pool->alloc_objects> internally, to allocate objects if a GC run fails
547to free any old objects.
548
549=back
550
551=head4 Write Barrier
552
553Each GC core has to provide the following macros. All of these might be
554defined empty, for GC cores which do not use them.
555
556=over 4
557
558=item C<GC_WRITE_BARRIER(Interp *, PMC *agg, PMC *old, PMC *new)>
559
560This macro is invoked when in aggregate C<agg> the element C<old> is getting
561overwritten by C<new>. Either C<old>, C<new>, or both may be NULL.
562
563=item C<GC_WRITE_BARRIER_KEY(Interp *, PMC *agg, PMC *old, PObj
564*old_key, PMC *new, PObj *new_key)>
565
566Similar to C<GC_WRITE_BARRIER>. Invoked when a hash key C<new_key> is
567inserted into hash C<agg> with value C<new>, possibly replacing a key/value
568pair C<old_key> and C<old>, respectively. Any of C<old>, C<old_key>, C<new>
569or C<new_key> might be C<NULL>.
570
571=back
572
573=head3 Blocking GC
574
575Being able to block GC is important, so newly allocated Buffers or PMCs won't
576be collected before they're attached to the live tree. Parrot provides locking
577mechanisms to prevent the GC from taking certain actions, such as marking
578or sweeping. GC block functions are nesting, and multiple calls to a lock
579function requires the same number of calls to the corresponding unlock
580function in order to operate the GC normally again. The following functions
581are used to block the GC from performing certain actions:
582
583=over 4
584
585=item Parrot_block_GC_mark(Interp *interpreter)
586
587Block the GC mark phase for the passed interpreter, but do not block the sweep
588phase. In a stop-the-world collector, this will prevent the entire collection
589run, but in an incremental collector this will only block if the GC is in the
590trace state.
591
592=item Parrot_block_GC_sweep(Interp *interpreter)
593
594Block the GC sweep phase for the passed interpreter, but do not block the
595trace phase.
596
597=item Parrot_unblock_GC_mark(Interp *interpreter)
598
599Unblock the GC mark phase for the passed interpreter, but do not unblock a
600blocked sweep phase, if it is blocked using C<Parrot_block_GC_sweep>.
601
602=item Parrot_unblock_GC_sweep(Interp *interpreter)
603
604Unblock the GC sweep phase for the passed interpreter, but do not unblock the
605mark phase if it has been blocked by C<Parrot_block_GC_mark>.
606
607=item Parrot_is_blocked_GC_mark(Interp *interpreter)
608
609Test whether the mark phase has been blocked. Notice that the sweep phase can
610be locked independently and cannot be determined using this function.
611
612=item Parrot_is_blocked_GC_sweep(Interp *interpreter)
613
614Test whether the sweep phase has been blocked. Notice that the mark phase can
615be locked independently and cannot be determined using this function.
616
617=back
618
619=head3 PMC/Buffer API
620
621=head4 Flags
622
623For PMCs and Buffers to be collected properly, you must set the appropriate
624flags on them. Directly manipulating these flags is not recommended because
625the exact values can be changed over time. A series of macros have been
626created in F<include/parrot/pobject.h> that set and check for these flags.
627Always use these provided macros when you need to test or set these flags.
628
629=over 4
630
631=item PObj_custom_destroy_FLAG
632
633The PMC has some sort of active destructor, and will have that destructor
634called when the PMC is destroyed. The destructor is typically called from
635within C<src/gc/api.c:Parrot_gc_free_pmc>.
636
637=item PObj_custom_mark_FLAG
638
639The C<mark> vtable slot will be called during the GC mark phase. The mark
640function must call C<Parrot_gc_mark_PObj_alive> for all non-NULL objects
641(Buffers and PMCs) that PMC refers to. This flag is typically tested and the
642custom mark VTABLE function called from C<src/gc/api.c:mark_special>.
643
644=item PObj_external_FLAG
645
646Set if the buffer points to memory that came from outside Parrot's memory
647system.
648
649=item PObj_sysmem_FLAG
650
651Set if the memory came from the system malloc. When the buffer is considered
652dead, the memory will be freed back to the system.
653
654=item PObj_COW_FLAG
655
656The buffer's memory is copy on write. Any changes to the buffer must first
657have the buffer's memory copied. The COW flag should then be removed.
658
659=back
660
661The following flags can be used by the GC subsystem:
662
663=over 4
664
665=item PObj_live_FLAG
666
667The system considers the object to be alive for collection purposes. Objects
668with this flag set should never be collected, freed, destroyed, or put on the
669free list.
670
671=item PObj_on_free_list_FLAG
672
673The object is unused, and on the free list for later allocation.
674
675=item PObj_custom_GC_FLAG
676
677Mark the buffer as needing GC.
678
679=back
680
681=head2 References
682
683"Uniprocessor Garbage Collection Techniques"
684L<http://www.cs.rice.edu/~javaplt/311/Readings/wilson92uniprocessor.pdf>
685
686"A unified theory of garbage collection":
687L<http://portal.acm.org/citation.cfm?id=1028982>
688
689"Scalable Locality-Conscious Multithreaded Memory Allocation":
690L<http://people.cs.vt.edu/~scschnei/papers/ismm06.pdf>
691
692"Parallel and concurrent garbage collectors":
693L<http://chaoticjava.com/posts/parallel-and-concurrent-garbage-collectors/>
694
695"Region-Based Memory Management":
696L<http://www.irisa.fr/prive/talpin/papers/ic97.pdf>
697
698Dan's first musings on the GC subsystem:
699L<http://www.mail-archive.com/perl6-all@perl.org/msg14072.html>
700
701Semi-timely and ordered destruction:
702L<http://www.sidhe.org/~dan/blog/archives/000199.html>
703
704=cut
705
706__END__
707Local Variables:
708  fill-column:78
709End:
710vim: expandtab shiftwidth=4:
711