协程栈大小支持可配置

Signed-off-by: chendi <cdrom000@126.com>
This commit is contained in:
chendi 2024-09-26 17:47:10 +08:00
parent 0737b228ad
commit 55f598f67d
4 changed files with 9 additions and 2 deletions

View File

@ -59,6 +59,7 @@ config("ffrt_config") {
"FFRT_TRACE_RECORD_LEVEL=1",
"FFRT_SEND_EVENT",
"FFRT_ALLOCATOR_MMAP_SIZE=${ffrt_allocator_mmap_size}",
"FFRT_STACK_SIZE=${ffrt_stack_size}",
]
#ffrt_release_defines = [

View File

@ -18,7 +18,8 @@
],
"features": [
"ffrt_support_enable",
"ffrt_allocator_mmap_size"
"ffrt_allocator_mmap_size",
"ffrt_stack_size"
],
"adapted_system_type": [
"standard"

View File

@ -15,4 +15,5 @@ declare_args() {
ffrt_async_stack_enable = true
ffrt_task_local_enable = false
ffrt_allocator_mmap_size = "8 * 1024 * 1024"
ffrt_stack_size = "1 << 20"
}

View File

@ -30,6 +30,10 @@ constexpr size_t STACK_MAGIC = 0x7BCDABCDABCDABCD;
constexpr size_t STACK_MAGIC = 0x7BCDABCDABCDABCD;
#endif
#ifndef FFRT_STACK_SIZE
#define FFRT_STACK_SIZE (1 << 20)
#endif
namespace ffrt {
class CPUEUTask;
struct WaitEntry;
@ -52,7 +56,7 @@ enum class BlockType {
BLOCK_THREAD
};
constexpr uint64_t STACK_SIZE = 1 << 20;
constexpr uint64_t STACK_SIZE = FFRT_STACK_SIZE;
constexpr uint64_t MIN_STACK_SIZE = 32 * 1024;
using CoCtx = struct co2_context;