Implement memory.grow and limit heap space base offset to 1G (#36)
* Implement memory profiler, optimize memory usage, modify code indent * Implement memory.grow and limit heap space base offset to 1G; modify iwasm build type to Release and 64 bit by default
This commit is contained in:
@ -52,6 +52,12 @@ int bh_memory_init_with_allocator(void *malloc_func, void *free_func);
|
||||
*/
|
||||
void bh_memory_destroy();
|
||||
|
||||
/**
|
||||
* Get the pool size of memory, if memory is initialized with allocator,
|
||||
* return 1GB by default.
|
||||
*/
|
||||
int bh_memory_pool_size();
|
||||
|
||||
#if BEIHAI_ENABLE_MEMORY_PROFILING == 0
|
||||
|
||||
/**
|
||||
|
||||
@ -80,6 +80,15 @@
|
||||
#define WORKING_FLOW_HEAP_SIZE 0
|
||||
*/
|
||||
|
||||
/* Support memory.grow opcode and enlargeMemory function */
|
||||
#define WASM_ENABLE_MEMORY_GROW 1
|
||||
|
||||
/* The max percentage of global heap that app memory space can grow */
|
||||
#define APP_MEMORY_MAX_GLOBAL_HEAP_PERCENT 1 / 3
|
||||
|
||||
/* Default base offset of app heap space */
|
||||
#define DEFAULT_APP_HEAP_BASE_OFFSET (1 * BH_GB)
|
||||
|
||||
/* Default min/max heap size of each app */
|
||||
#define APP_HEAP_SIZE_DEFAULT (8 * 1024)
|
||||
#define APP_HEAP_SIZE_MIN (2 * 1024)
|
||||
|
||||
Reference in New Issue
Block a user