Commit Graph

5 Commits

Author SHA1 Message Date
Matthew Flatt
2ada6d0e89 break link to namespaces from from closures over top-/module-level vars
- the `lam' structure from `compiler/zo-struct' changed to include a
   `toplevel-map' field

 This change helps solve a finalization problem in `racket/draw',
 which in turn sigificantly reduces the peak memory use of `raco setup'
 during the doc-building phase (because some documents load `racket/draw'
 to render images, and multiple copies of `racket/draw' were retained
 before finalization was fixed).

 The change is an extreme way to solve a specific finalization
 problem, but it's a kind of space-safety improvement; space safety
 almost never matters, but when it does, then working around a lack of
 space safety is practically impossible. In this case, it's not clear
 how to otherwise solve the `racket/draw' finalization problem.

 The improvement doesn't change the representation of closures, but it
 requires special cooperation with the GC. All closures in a module
 continue to share the same array of globals (plus syntax objects);
 that is, instead of completely flat closures, Racket uses a two-level
 environment where top-/module-level variables are grouped
 together. The code half of a closure now records which
 top-/module-level variables the body code actually uses, and the mark
 phase of GC consults this information to retain only parts of the
 top-/module-level environment frame that are actually used by some
 closure (or all of the frame if it is accessible through some other
 route).  In other words, the GC supports a kind of "dependent
 reference" to an array that is indexed by positions into the array
 --- except that the code is more in the "Racket" directory instead of
 the "GC" directory, since it's so specific to the closure
 representation.
2011-05-03 06:57:49 -06:00
Matthew Flatt
e40e27435d 301.7
svn: r2304
2006-02-23 13:19:03 +00:00
Matthew Flatt
58b6198fa5 3m and mzc
svn: r1353
2005-11-19 16:19:42 +00:00
Matthew Flatt
aa0692e7cd 299.406
svn: r1287
2005-11-11 21:26:46 +00:00
Eli Barzilay
017d151d59 Adding collects, with all the right properties (except eoln-style).
svn: r3
2005-05-27 18:56:37 +00:00