Skip to content

Commit fc6d5e9

Browse files
committed
enable strict mode & linux emulation for malloc_usable_size
1 parent 67ff7d4 commit fc6d5e9

File tree

98 files changed

+1288
-2028
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

98 files changed

+1288
-2028
lines changed

.vscode/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
"math.h": "c",
1010
"stdbool.h": "c",
1111
"emscripten.h": "c",
12-
"quickjs-atom.h": "c"
12+
"quickjs-atom.h": "c",
13+
"malloc.h": "c"
1314
},
1415
"files.exclude": {
1516
".yarn/releases/*": true

doc/@jitl/quickjs-ffi-types/exports.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ for the Emscripten stack.
8484
8585
#### Source
8686

87-
[packages/quickjs-ffi-types/src/emscripten-types.ts:246](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L246)
87+
[packages/quickjs-ffi-types/src/emscripten-types.ts:248](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L248)
8888

8989
***
9090

@@ -145,7 +145,7 @@ State of a promise.
145145

146146
#### Source
147147

148-
[packages/quickjs-ffi-types/src/ffi-types.ts:131](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-types.ts#L131)
148+
[packages/quickjs-ffi-types/src/ffi-types.ts:136](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-types.ts#L136)
149149

150150
***
151151

@@ -368,7 +368,7 @@ module code
368368

369369
#### Source
370370

371-
[packages/quickjs-ffi-types/src/ffi-types.ts:106](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-types.ts#L106)
371+
[packages/quickjs-ffi-types/src/ffi-types.ts:111](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-types.ts#L111)
372372

373373
***
374374

@@ -410,7 +410,7 @@ Bitfield options for QTS_GetOwnPropertyNames
410410
411411
#### Source
412412

413-
[packages/quickjs-ffi-types/src/ffi-types.ts:121](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-types.ts#L121)
413+
[packages/quickjs-ffi-types/src/ffi-types.ts:126](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-types.ts#L126)
414414

415415
***
416416

@@ -488,7 +488,7 @@ Bitfield options for QTS_NewContext intrinsics
488488
489489
#### Source
490490

491-
[packages/quickjs-ffi-types/src/ffi-types.ts:111](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-types.ts#L111)
491+
[packages/quickjs-ffi-types/src/ffi-types.ts:116](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-types.ts#L116)
492492

493493
***
494494

@@ -512,7 +512,7 @@ Bitfield options for QTS_NewContext intrinsics
512512
513513
#### Source
514514

515-
[packages/quickjs-ffi-types/src/ffi-types.ts:126](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-types.ts#L126)
515+
[packages/quickjs-ffi-types/src/ffi-types.ts:131](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-types.ts#L131)
516516

517517
***
518518

@@ -536,7 +536,7 @@ Bitfield options for QTS_NewContext intrinsics
536536
537537
#### Source
538538

539-
[packages/quickjs-ffi-types/src/ffi-types.ts:131](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-types.ts#L131)
539+
[packages/quickjs-ffi-types/src/ffi-types.ts:136](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-types.ts#L136)
540540

541541
## Functions
542542

@@ -569,7 +569,7 @@ Bitfield options for QTS_NewContext intrinsics
569569
570570
#### Source
571571

572-
[packages/quickjs-ffi-types/src/ffi-types.ts:136](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-types.ts#L136)
572+
[packages/quickjs-ffi-types/src/ffi-types.ts:141](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/ffi-types.ts#L141)
573573

574574
***
575575

doc/@jitl/quickjs-ffi-types/interfaces/EmscriptenModule.md

Lines changed: 42 additions & 111 deletions
Original file line numberDiff line numberDiff line change
@@ -13,24 +13,15 @@ QuickJS.
1313

1414
- [Extends](EmscriptenModule.md#extends)
1515
- [Properties](EmscriptenModule.md#properties)
16-
- [FAST\_MEMORY](EmscriptenModule.md#fast-memory)
17-
- [HEAP16](EmscriptenModule.md#heap16)
18-
- [HEAP32](EmscriptenModule.md#heap32)
19-
- [HEAP8](EmscriptenModule.md#heap8)
20-
- [HEAPF32](EmscriptenModule.md#heapf32)
21-
- [HEAPF64](EmscriptenModule.md#heapf64)
22-
- [HEAPU16](EmscriptenModule.md#heapu16)
23-
- [HEAPU32](EmscriptenModule.md#heapu32)
2416
- [HEAPU8](EmscriptenModule.md#heapu8)
25-
- [TOTAL\_MEMORY](EmscriptenModule.md#total-memory)
26-
- [TOTAL\_STACK](EmscriptenModule.md#total-stack)
2717
- [wasmBinary?](EmscriptenModule.md#wasmbinary)
2818
- [wasmMemory?](EmscriptenModule.md#wasmmemory)
2919
- [Methods](EmscriptenModule.md#methods)
3020
- [UTF8ToString()](EmscriptenModule.md#utf8tostring)
3121
- [\_free()](EmscriptenModule.md#free)
3222
- [\_malloc()](EmscriptenModule.md#malloc)
3323
- [cwrap()](EmscriptenModule.md#cwrap)
24+
- [getValue()](EmscriptenModule.md#getvalue)
3425
- [instantiateWasm()?](EmscriptenModule.md#instantiatewasm)
3526
- [lengthBytesUTF8()](EmscriptenModule.md#lengthbytesutf8)
3627
- [locateFile()?](EmscriptenModule.md#locatefile)
@@ -43,113 +34,13 @@ QuickJS.
4334

4435
## Properties
4536

46-
### FAST\_MEMORY
47-
48-
> **FAST\_MEMORY**: `number`
49-
50-
#### Source
51-
52-
[packages/quickjs-ffi-types/src/emscripten-types.ts:168](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L168)
53-
54-
***
55-
56-
### HEAP16
57-
58-
> **HEAP16**: `Int16Array`
59-
60-
#### Source
61-
62-
[packages/quickjs-ffi-types/src/emscripten-types.ts:158](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L158)
63-
64-
***
65-
66-
### HEAP32
67-
68-
> **HEAP32**: `Int32Array`
69-
70-
#### Source
71-
72-
[packages/quickjs-ffi-types/src/emscripten-types.ts:159](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L159)
73-
74-
***
75-
76-
### HEAP8
77-
78-
> **HEAP8**: `Int8Array`
79-
80-
#### Source
81-
82-
[packages/quickjs-ffi-types/src/emscripten-types.ts:157](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L157)
83-
84-
***
85-
86-
### HEAPF32
87-
88-
> **HEAPF32**: `Float32Array`
89-
90-
#### Source
91-
92-
[packages/quickjs-ffi-types/src/emscripten-types.ts:163](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L163)
93-
94-
***
95-
96-
### HEAPF64
97-
98-
> **HEAPF64**: `Float64Array`
99-
100-
#### Source
101-
102-
[packages/quickjs-ffi-types/src/emscripten-types.ts:164](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L164)
103-
104-
***
105-
106-
### HEAPU16
107-
108-
> **HEAPU16**: `Uint16Array`
109-
110-
#### Source
111-
112-
[packages/quickjs-ffi-types/src/emscripten-types.ts:161](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L161)
113-
114-
***
115-
116-
### HEAPU32
117-
118-
> **HEAPU32**: `Uint32Array`
119-
120-
#### Source
121-
122-
[packages/quickjs-ffi-types/src/emscripten-types.ts:162](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L162)
123-
124-
***
125-
12637
### HEAPU8
12738

12839
> **HEAPU8**: `Uint8Array`
12940
13041
#### Source
13142

132-
[packages/quickjs-ffi-types/src/emscripten-types.ts:160](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L160)
133-
134-
***
135-
136-
### TOTAL\_MEMORY
137-
138-
> **TOTAL\_MEMORY**: `number`
139-
140-
#### Source
141-
142-
[packages/quickjs-ffi-types/src/emscripten-types.ts:167](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L167)
143-
144-
***
145-
146-
### TOTAL\_STACK
147-
148-
> **TOTAL\_STACK**: `number`
149-
150-
#### Source
151-
152-
[packages/quickjs-ffi-types/src/emscripten-types.ts:166](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L166)
43+
[packages/quickjs-ffi-types/src/emscripten-types.ts:162](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L162)
15344

15445
***
15546

@@ -277,6 +168,46 @@ https://emscripten.org/docs/api_reference/preamble.js.html#UTF8ToString
277168

278169
***
279170

171+
### getValue()
172+
173+
#### getValue(ptr, type)
174+
175+
> **getValue**(`ptr`, `type`): `number`
176+
177+
##### Parameters
178+
179+
**ptr**: `number`
180+
181+
**type**: `"i8"` \| `"i16"` \| `"i32"` \| `"float"` \| `"double"`
182+
183+
##### Returns
184+
185+
`number`
186+
187+
##### Source
188+
189+
[packages/quickjs-ffi-types/src/emscripten-types.ts:155](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L155)
190+
191+
#### getValue(ptr, type)
192+
193+
> **getValue**(`ptr`, `type`): `bigint`
194+
195+
##### Parameters
196+
197+
**ptr**: `number`
198+
199+
**type**: `"i64"`
200+
201+
##### Returns
202+
203+
`bigint`
204+
205+
##### Source
206+
207+
[packages/quickjs-ffi-types/src/emscripten-types.ts:156](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L156)
208+
209+
***
210+
280211
### instantiateWasm()?
281212

282213
> **`optional`** **instantiateWasm**(`imports`, `onSuccess`): `Exports` \| `Promise`\<`Exports`\>

doc/@jitl/quickjs-ffi-types/interfaces/EmscriptenModuleLoader.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
## Source
2424

25-
[packages/quickjs-ffi-types/src/emscripten-types.ts:249](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L249)
25+
[packages/quickjs-ffi-types/src/emscripten-types.ts:251](https://github.com/justjake/quickjs-emscripten/blob/main/packages/quickjs-ffi-types/src/emscripten-types.ts#L251)
2626

2727
***
2828

0 commit comments

Comments
 (0)