Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.postscript > #1715

Re: How can systemdict contain userdict?

Newsgroups comp.lang.postscript
Date 2013-10-20 21:58 -0700
References <88ad8558-3e12-41d4-85ce-7c77d470ae9d@googlegroups.com>
Message-ID <69b77a89-eac5-4345-b3df-89091906bbb5@googlegroups.com> (permalink)
Subject Re: How can systemdict contain userdict?
From luser- -droog <mijoryx@yahoo.com>

Show all headers | View raw


On Saturday, October 5, 2013 10:34:46 PM UTC-5, luser- -droog wrote:
> How can systemdict contain userdict? 
> 
> Composite objects in global memory are not permitted to contain references to objects in local memory. How then is systemdict able to contain references to userdict, errordict and $error?
> 
> 
> The advantage of this restriction are clear when you consider that garbage collection can be performed separately for local and global VMs. A collection of local VM can be performed more cheaply since only local VM needs to be scanned. A collection of global VM, on the other hand, must scan both global and local VMs.
> 
> 
> userdict is probably fine, since the stacks are part of the root set. But how to keep $error from being garbage collected when it exists in local VM, but its reference is in global VM (in systemdict) and therefore not encountered during a scan of local VM roots?

PLRM 3ed, p 66:

  Note: systemdict, a global dictionary, contains several 
  entries whose values are local dictionaries, such as 
  userdict and $error. This is an exception to the normal 
  rule, described in Section 3.7.2, “Local and Global VM,” 
  that prohibits objects in global VM from referring to 
  objects in local VM.

So, yes it's a straight exception to the rule.

And for the rest, ya gotta do what you gotta do!

Back to comp.lang.postscript | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

How can systemdict contain userdict? luser- -droog <mijoryx@yahoo.com> - 2013-10-05 20:34 -0700
  Re: How can systemdict contain userdict? luser- -droog <mijoryx@yahoo.com> - 2013-10-06 22:43 -0700
    Re: How can systemdict contain userdict? luser- -droog <mijoryx@yahoo.com> - 2013-10-07 04:11 -0700
      Re: How can systemdict contain userdict? ken <ken@spamcop.net> - 2013-10-07 17:22 +0100
    Re: How can systemdict contain userdict? luser- -droog <mijoryx@yahoo.com> - 2013-10-08 17:35 -0700
  Re: How can systemdict contain userdict? luser- -droog <mijoryx@yahoo.com> - 2013-10-20 21:58 -0700

csiph-web