mirror of
https://gitee.com/openharmony/resourceschedule_ffrt
synced 2024-11-26 23:00:25 +00:00
协程栈大小支持可配置
Signed-off-by: chendi <cdrom000@126.com>
This commit is contained in:
parent
0737b228ad
commit
55f598f67d
1
BUILD.gn
1
BUILD.gn
@ -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 = [
|
||||
|
@ -18,7 +18,8 @@
|
||||
],
|
||||
"features": [
|
||||
"ffrt_support_enable",
|
||||
"ffrt_allocator_mmap_size"
|
||||
"ffrt_allocator_mmap_size",
|
||||
"ffrt_stack_size"
|
||||
],
|
||||
"adapted_system_type": [
|
||||
"standard"
|
||||
|
1
ffrt.gni
1
ffrt.gni
@ -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"
|
||||
}
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user