File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ export class HEADER {
14
14
}
15
15
16
16
/** Size of the common runtime header. */
17
- @inline export const HEADER_SIZE : usize = ( offsetof < ArrayBuffer > ( ) + AL_MASK ) & ~ AL_MASK ;
17
+ @inline export const HEADER_SIZE : usize = ( offsetof < HEADER > ( ) + AL_MASK ) & ~ AL_MASK ;
18
18
/** Magic value used to validate common headers. */
19
19
@inline export const HEADER_MAGIC : usize = < usize > 0xA55E4B17 ;
20
20
@@ -131,7 +131,7 @@ export function REGISTER<T>(ref: usize): void {
131
131
// === String =====================================================================================
132
132
133
133
/** Size of a string header, excl. common runtime header. */
134
- @inline export const STRING_HEADER_SIZE : usize = ( offsetof < String > ( ) + AL_MASK ) & ~ AL_MASK ;
134
+ @inline export const STRING_HEADER_SIZE : usize = ( offsetof < String > ( ) + 1 ) & ~ 1 ; // 2 byte aligned
135
135
136
136
/** Allocates a new String and returns a pointer to it. */
137
137
@inline export function ALLOC_STRING ( length : u32 ) : String {
@@ -142,3 +142,5 @@ export function REGISTER<T>(ref: usize): void {
142
142
@inline export function REALLOC_STRING ( ref : usize , length : u32 ) : String {
143
143
return changetype < String > ( REALLOC ( ref , STRING_HEADER_SIZE + ( length << 1 ) ) ) ;
144
144
}
145
+
146
+ // ...
You can’t perform that action at this time.
0 commit comments