[erlang-questions] Is there a good source for documentation on BEAM?

Richard O'Keefe <>
Fri May 11 00:42:01 CEST 2012


On 10/05/2012, at 8:28 PM, Björn Gustavsson wrote:

> On Thu, May 10, 2012 at 8:10 AM, Richard O'Keefe <> wrote:
> [...]
>> Joe's little document made it clear that
>> (a) there are a lot more X registers allowed in Erlang that in
>>    Quintus Prolog;
>> (b) maintaining them is more expensive than in Quintus Prolog;
>> (c) the nilling instructions I expected don't exist;
>> (d) there is a (temporary) space leak: if register K is live
>>    at an allocation point, all registers <= K are assumed to
>>    be live.
> 
> There is not a temporary space leak in practice, because the compiler
> will insert an instruction that will clear (set to NIL) each dead register
> below K before any allocation point.

And *THAT* is precisely the kind of BEAM documentation that
volunteers will not be able to reconstruct without a disproportionate
amount of effort:

	This operand gives the number of the highest live
	X register, so that if a garbage collection is needed,
	the collector knows which registers to trace from.
	If any X registers with smaller numbers are dead at
	this point, the compiler MUST ensure that they contain
	immediate values, by nilling them if necessary.





More information about the erlang-questions mailing list