User defined memory allocator for different purposes (#3316)
Some issues are related with memory fragmentation, which may cause the linear memory cannot be allocated. In WAMR, the memory managed by the system is often trivial, but linear memory usually directly allocates a large block and often remains unchanged for a long time. Their sensitivity and contribution to fragmentation are different, which is suitable for different allocation strategies. If we can control the linear memory's allocation, do not make it from system heap, the overhead of heap management might be avoided. Add `mem_alloc_usage_t usage` as the first argument for user defined malloc/realloc/free functions when `WAMR_BUILD_ALLOC_WITH_USAGE` cmake variable is set as 1, and make passing `Alloc_For_LinearMemory` to the argument when allocating the linear memory.
This commit is contained in:
committed by
GitHub
parent
68bd30c6f9
commit
ba59e56e19
@ -254,6 +254,10 @@ Currently we only profile the memory consumption of module, module_instance and
|
||||
|
||||
> See [Enable segue optimization for wamrc when generating the aot file](./perf_tune.md#3-enable-segue-optimization-for-wamrc-when-generating-the-aot-file) for more details.
|
||||
|
||||
#### **User defined linear memory allocator**
|
||||
- **WAMR_BUILD_ALLOC_WITH_USAGE**=1/0, default to disable if not set
|
||||
> Notes: by default, the linear memory is allocated by system. when it's set to 1 and Alloc_With_Allocator is selected, it will be allocated by customer.
|
||||
|
||||
#### **Enable running PGO(Profile-Guided Optimization) instrumented AOT file**
|
||||
- **WAMR_BUILD_STATIC_PGO**=1/0, default to disable if not set
|
||||
> Note: See [Use the AOT static PGO method](./perf_tune.md#5-use-the-aot-static-pgo-method) for more details.
|
||||
|
||||
Reference in New Issue
Block a user