Plan 9 from Bell Labs’s /usr/web/sources/contrib/fernan/nhc98/docs/implementation-notes/memorylayout

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


Each heap cell is identified by the leading word, which can either
be a tag, or a pointer.

A tag word is constructed by one of these C macros:

  CONSTR(c,s,ws)
	Construct a tag (i.e. a header for a data node) where there is
	a mixture of pointers and basic values amongst the data items:
		c  = number of the constructor
		s  = size = total number of data items in the node
		ws = number of data items which are pointers to
		     other nodes
		The number of non-pointers is therefore (s - ws).
	The complete node has layout:
		| tag | pointers | non-pointers |

  CONSTRW(s,e)
	Construct a tag for a node containing a single basic data item
	(non-pointer), but it could be larger than a single word,
	e.g. Integer, Double.
		s = size = number of words occupied by the node
		e = extra information, a 2-bit flag used e.g. to indicate
		    that a GMP Integer is negative.

  CONSTRP(s,e)
	Construct a tag for a value where there is a single constructor,
	and all the data items contained in it are pointers, e.g. Array.
	Used only by hand-written code - never generated by the compiler.
		s = size = number of pointers
		e = extra information, currently unused.

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.