LMMC
Lamina Mathematic core
载入中...
搜索中...
未找到
init.c
浏览该文件的文档.
1
5#include "lmmc/init.h"
6
7#include <lmmp.h>
8
9static _Thread_local size_t lmmc_lifecycle_depth = 0;
10
12 if (lmmc_lifecycle_depth == SIZE_MAX) {
14 }
15 if (lmmc_lifecycle_depth == 0) {
16 lmmp_global_init();
17 }
18 ++lmmc_lifecycle_depth;
19 return LMMC_STATUS_OK;
20}
21
23 if (lmmc_lifecycle_depth == 0) {
25 }
26 --lmmc_lifecycle_depth;
27 if (lmmc_lifecycle_depth == 0) {
28 lmmp_global_deinit();
29 }
30 return LMMC_STATUS_OK;
31}
32
34 if (lmmc_lifecycle_depth == 0) {
36 }
37 if (lmmc_lifecycle_depth != 1) {
38 return LMMC_STATUS_BUSY;
39 }
40 if (lmmp_stack_deinit() != 0) {
42 }
43 if (lmmp_stack_init(size) != 0) {
45 }
46 return LMMC_STATUS_OK;
47}
LMMC 当前线程的初始化与底层栈管理接口.
lmmc_status_t lmmc_stack_reset(size_t pool_size)
Reset the current thread's LMMP temporary-stack capacity.
定义 init.c:33
lmmc_status_t lmmc_deinit(void)
Release one lifecycle lease owned by the current thread.
定义 init.c:22
lmmc_status_t lmmc_init(void)
获取当前线程的 LMMC 生命周期租约.
定义 init.c:11
lmmc_status_t
LMMC 库统一返回的状态码.
@ LMMC_STATUS_REFERENCE_LIMIT
@ LMMC_STATUS_OK
@ LMMC_STATUS_BUSY
@ LMMC_STATUS_NOT_INITIALIZED