Skip to content

Commit 75e7bc8

Browse files
committed
Update docs according to AssemblyScript/assemblyscript#2559
The class IDs for ArrayBuffer and String have now been incremented by 1.
1 parent 877ea48 commit 75e7bc8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/runtime.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,9 @@ Standard library data types use the following layouts:
9898

9999
Class | Description
100100
----------------|-------------
101-
ArrayBuffer | Buffers always use class id `0`, with their untyped data as the payload.
102-
String | Strings always use class id `1`, with their 16-bit char codes (UTF-16 code units, allowing isolated surrogates like JS) as the payload. For example, if `rtSize` is `8`, the string's `.length` is `4`.
101+
Object | Object, the base class of all managed classes, has a class id of `0`.
102+
ArrayBuffer | Buffers always use class id `1`, with their untyped data as the payload.
103+
String | Strings always use class id `2`, with their 16-bit char codes (UTF-16 code units, allowing isolated surrogates like JS) as the payload. For example, if `rtSize` is `8`, the string's `.length` is `4`.
103104
TypedArray | Typed arrays are objects composed of `buffer` (the reference to the viewed `ArrayBuffer`), `dataStart` (the start pointer into `buffer`) and `byteLength` fields, in this order. The respective id is picked sequentially and not predetermined.
104105
Array\<T> | Normal arrays use the same layout as typed arrays, with an additional mutable `length` field coming last.
105106
StaticArray\<T> | Static arrays do not need indirection due to not being resizable, and they have their data right in the payload, aligned according to `T`. Can be thought of as a typed buffer.

0 commit comments

Comments
 (0)