LMMC
Lamina Mathematic core
载入中...
搜索中...
未找到
init.h 文件参考

LMMC 当前线程的初始化与底层栈管理接口. 更多...

#include <stddef.h>
#include "lmmc/status.h"
init.h 的引用(Include)关系图:
此图展示该文件被哪些文件直接或间接地引用了:

浏览该文件的源代码.

函数

lmmc_status_t lmmc_init (void)
 获取当前线程的 LMMC 生命周期租约.
lmmc_status_t lmmc_deinit (void)
 Release one lifecycle lease owned by the current thread.
lmmc_status_t lmmc_stack_reset (size_t pool_size)
 Reset the current thread's LMMP temporary-stack capacity.
long long lmmc_debug_leaks_get_count (void)
 Get the number of persistent allocations currently owned by LMMC.

详细描述

LMMC 当前线程的初始化与底层栈管理接口.

LMMC 在内部使用 LMMP 的线程局部临时内存.每个调用线程必须独立获取 生命周期租约,并在同一线程中成对释放.

在文件 init.h 中定义.

函数说明

◆ lmmc_init()

lmmc_status_t lmmc_init ( void )

获取当前线程的 LMMC 生命周期租约.

调用支持嵌套;首次获取时初始化当前线程的 LMMP 资源. LMMP temporary-stack allocation follows LMMP's fail-fast contract and therefore cannot be translated into LMMC_STATUS_ALLOCATION_FAILED.

返回
LMMC_STATUS_OK on success or LMMC_STATUS_REFERENCE_LIMIT when the current thread's lease count cannot be incremented.

在文件 init.c 第 11 行定义.

引用了 lmmc_init(), LMMC_STATUS_OK , 以及 LMMC_STATUS_REFERENCE_LIMIT.

被这些函数引用 lmmc_init().

函数调用图:
这是这个函数的调用关系图:

◆ lmmc_deinit()

lmmc_status_t lmmc_deinit ( void )

Release one lifecycle lease owned by the current thread.

A final matching call releases only the current thread's LMMP temporary stack state. Persistent LMMC objects use the recoverable heap bridge and may outlive deinitialization; concurrent mutation still requires external synchronization.

返回
LMMC_STATUS_OK on success or LMMC_STATUS_NOT_INITIALIZED when no lease is active.

在文件 init.c 第 22 行定义.

引用了 lmmc_deinit(), LMMC_STATUS_NOT_INITIALIZED , 以及 LMMC_STATUS_OK.

被这些函数引用 lmmc_deinit().

函数调用图:
这是这个函数的调用关系图:

◆ lmmc_stack_reset()

lmmc_status_t lmmc_stack_reset ( size_t pool_size)

Reset the current thread's LMMP temporary-stack capacity.

The reset is rejected only while this thread holds nested lifecycle leases. Persistent vectors, matrices, tensors, interpolation objects, and RNG handles do not block a temporary-stack reset.

参数
pool_sizeRequested LMMP temporary-pool size in bytes.
返回
LMMC_STATUS_OK on success, LMMC_STATUS_NOT_INITIALIZED without an active lease or when the lower-level stack cannot be reinitialized, or LMMC_STATUS_BUSY for a nested lease.
注解
LMMP allocation failure remains fail-fast and does not return a recoverable LMMC status.

在文件 init.c 第 33 行定义.

引用了 lmmc_stack_reset(), LMMC_STATUS_BUSY, LMMC_STATUS_NOT_INITIALIZED , 以及 LMMC_STATUS_OK.

被这些函数引用 lmmc_stack_reset().

函数调用图:
这是这个函数的调用关系图:

◆ lmmc_debug_leaks_get_count()

long long lmmc_debug_leaks_get_count ( void )

Get the number of persistent allocations currently owned by LMMC.

Available only when compiled with LMMC_DEBUG_LEAKS. The process-wide atomic count follows bridge allocations and remains correct when an object is destroyed on a different thread.

返回
Current live bridge-allocation count.

在文件 memory_bridge.c 第 111 行定义.

引用了 lmmc_debug_leaks_get_count().

被这些函数引用 lmmc_debug_leaks_get_count().

函数调用图:
这是这个函数的调用关系图: