File tree Expand file tree Collapse file tree 3 files changed +47
-4
lines changed
site/source/docs/api_reference
system/include/emscripten Expand file tree Collapse file tree 3 files changed +47
-4
lines changed Original file line number Diff line number Diff line change @@ -48,6 +48,9 @@ high level it consists of:
48
48
- :ref: `proxying-h `:
49
49
API for synchronously or asynchronously proxying work to a target pthread.
50
50
51
+ - :ref: `stack-h `:
52
+ Inspecting the WebAssembly data stack.
53
+
51
54
- :ref: `api-reference-advanced-apis `:
52
55
APIs for advanced users/core developers.
53
56
@@ -66,6 +69,7 @@ high level it consists of:
66
69
trace.h
67
70
fiber.h
68
71
proxying.h
72
+ stack.h
69
73
wasm_workers
70
74
wasm_audio_worklets
71
75
advanced-apis
Original file line number Diff line number Diff line change
1
+ .. _stack-h :
2
+
3
+ =======
4
+ stack.h
5
+ =======
6
+
7
+ The functions defined in `<emscripten/stack.h> ` allow inspecting
8
+ information about the WebAssembly data stack. This data stack is
9
+ the data contained within the linear memory.
10
+
11
+ .. c :function :: uintptr_t emscripten_stack_get_base (void)
12
+
13
+ Returns the starting address of the wasm stack. This is the address
14
+ that the stack pointer would point to when no bytes are in use on the
15
+ stack.
16
+
17
+ .. c:function:: uintptr_t emscripten_stack_get_end(void)
18
+
19
+ Returns the end address of the wasm stack. This is the address that
20
+ the stack pointer would point to when the whole stack is in use. (The
21
+ address pointed to by the end is not part of the stack itself). Note
22
+ that the stack grows down so the address returned by
23
+ `emscripten_stack_get_end()` is smaller than
24
+ :c:func:`emscripten_stack_get_base()`.
25
+
26
+ .. c:function:: void emscripten_stack_set_limits(void* base, void* end)
27
+
28
+ Sets the internal values reported by :c:func:`emscripten_stack_get_base()`
29
+ and :c:func:`emscripten_stack_get_end()`. This should only used by low
30
+ level libraries such as asyncify fibers.
31
+
32
+ .. c:function:: uintptr_t emscripten_stack_get_current(void)
33
+
34
+ Returns the current stack pointer.
35
+
36
+ .. c:function:: size_t emscripten_stack_get_free(void)
37
+
38
+ Returns the number of free bytes left on the stack. This is required
39
+ to be fast so that it can be called frequently.
Original file line number Diff line number Diff line change @@ -28,13 +28,13 @@ uintptr_t emscripten_stack_get_base(void);
28
28
uintptr_t emscripten_stack_get_end (void );
29
29
30
30
// Setup internal base/end values based on the initial values that were either
31
- // set at compile time (in static linking) or instantiations time (for dynamic
31
+ // set at compile time (in static linking) or instantiation time (for dynamic
32
32
// linking).
33
33
void emscripten_stack_init (void );
34
34
35
- // Sets the internal values reported by emscripten_stack_get_base and
36
- // emscripten_stack_get_end. This should only used by low level libraries
37
- // such as asyncify fibres .
35
+ // Sets the internal values reported by emscripten_stack_get_base() and
36
+ // emscripten_stack_get_end() . This should only used by low level libraries
37
+ // such as asyncify fibers .
38
38
void emscripten_stack_set_limits (void * base , void * end );
39
39
40
40
// Returns the current stack pointer.
You can’t perform that action at this time.
0 commit comments