Skip to content

Commit

Permalink
R20 note on BEAM file format: compact term encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
kvakvs committed Oct 6, 2017
1 parent 14c1e6d commit 1ebae17
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions chapters/beam_modules.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,8 @@ The reason behind this complicated design is to try and fit as much type and val
----

NOTE: Since OTP 20 this tag format has been changed and the `Extended - Float` is gone. All following tag values are shifted down by 1: List is 2#10111, fpreg is 2#100111, alloc list is 2#110111 and literal is 2#1010111. Floating point values now go straight to literal area of the BEAM file.

It uses the first 3 bits of a first byte to store the tag which defines the type of the following value. If the bits were all 1 (special value 7 or ?tag_z from `beam_opcodes.hrl`), then a few more bits are used.

For values under 16, the value is placed entirely into bits 4-5-6-7 having bit 3 set to 0:
Expand Down

0 comments on commit 1ebae17

Please sign in to comment.