unify runtime header

This commit is contained in:
dcode
2019-04-08 23:22:13 +02:00
parent 8ec51423ca
commit c16c19e18d
152 changed files with 7726 additions and 7703 deletions

View File

@ -1,9 +0,0 @@
/** Indicates module capabilities. */
export const enum Capability {
/** No specific capabilities. */
NONE = 0,
/** Uses WebAssembly with 64-bit pointers. */
WASM64 = 1 << 0,
/** Garbage collector is present (full runtime header). */
GC = 1 << 1
}

View File

@ -15,18 +15,16 @@ import { ArrayBufferView } from "../arraybuffer";
classId: u32;
/** Size of the allocated payload. */
payloadSize: u32;
/** Reserved field for use by GC. Only present if GC is. */
/** Reserved field for use by GC. */
reserved1: usize; // itcm: tagged next
/** Reserved field for use by GC. Only present if GC is. */
/** Reserved field for use by GC. */
reserved2: usize; // itcm: prev
}
/** Common runtime header size. */
// @ts-ignore: decorator
@lazy
export const HEADER_SIZE: usize = isDefined(__ref_collect)
? (offsetof<HEADER>( ) + AL_MASK) & ~AL_MASK // full header if GC is present
: (offsetof<HEADER>("reserved1") + AL_MASK) & ~AL_MASK; // half header if GC is absent
export const HEADER_SIZE: usize = (offsetof<HEADER>() + AL_MASK) & ~AL_MASK;
/** Common runtime header magic. Used to assert registered/unregistered status. */
// @ts-ignore: decorator