|
75 | 75 | //! For resource-constrained targets, you can configure the initial memory allocation: |
76 | 76 | //! |
77 | 77 | //! ```rust |
78 | | -//! use tinywasm::{Store, Module, StackConfig}; |
| 78 | +//! use tinywasm::{Store, StackConfig}; |
79 | 79 | //! |
80 | 80 | //! // Create a store with minimal initial allocation (90% reduction in pre-allocated memory) |
81 | 81 | //! let config = StackConfig::new() |
82 | | -//! .with_value_stack_32_capacity(1024) // 1KB instead of 32KB |
83 | | -//! .with_value_stack_64_capacity(512) // 512B instead of 16KB |
84 | | -//! .with_value_stack_128_capacity(256) // 256B instead of 8KB |
85 | | -//! .with_value_stack_ref_capacity(128) // 128B instead of 1KB |
| 82 | +//! .with_value_stack_32_init_size(1024) // 1KB instead of 32KB |
| 83 | +//! .with_value_stack_64_init_size(512) // 512B instead of 16KB |
| 84 | +//! .with_value_stack_128_init_size(256) // 256B instead of 8KB |
| 85 | +//! .with_value_stack_ref_init_size(128) // 128B instead of 1KB |
86 | 86 |
|
87 | | -//! .with_block_stack_capacity(32); // 32 instead of 128 |
88 | | -//! let mut store = Store::with_config(config); |
| 87 | +//! .with_block_stack_init_size(32); // 32 instead of 128 |
| 88 | +//! let store = Store::with_config(config); |
89 | 89 | //! |
90 | 90 | //! // Or create a partial configuration (only override what you need) |
91 | 91 | //! let config = StackConfig::new() |
92 | | -//! .with_value_stack_32_capacity(2048); // Only override 32-bit stack size |
93 | | -//! let mut store = Store::with_config(config); |
| 92 | +//! .with_value_stack_32_init_size(2048); // Only override 32-bit stack size |
| 93 | +//! let store = Store::with_config(config); |
94 | 94 | //! ``` |
95 | 95 |
|
96 | 96 | mod std; |
|
0 commit comments