RT-Thread RTOS 1.2.0
An open source embedded real-time operating system
载入中...
搜索中...
未找到
mem.c 文件参考
#include <rthw.h>
#include <rtthread.h>
#include <rtdbg.h>
#include <finsh.h>
+ mem.c 的引用(Include)关系图:

浏览该文件的源代码.

宏定义

#define DBG_TAG   "kernel.mem"
 
#define DBG_LVL   DBG_INFO
 
#define MIN_SIZE   (sizeof(rt_uintptr_t) + sizeof(rt_size_t) + sizeof(rt_size_t))
 
#define MEM_MASK   ((~(rt_size_t)0) - 1)
 
#define MEM_USED(_mem)
 
#define MEM_FREED(_mem)
 
#define MEM_ISUSED(_mem)
 
#define MEM_POOL(_mem)
 
#define MEM_SIZE(_heap, _mem)
 
#define MIN_SIZE_ALIGNED   RT_ALIGN(MIN_SIZE, RT_ALIGN_SIZE)
 
#define SIZEOF_STRUCT_MEM   RT_ALIGN(sizeof(struct rt_small_mem_item), RT_ALIGN_SIZE)
 

函数

rt_smem_t rt_smem_init (const char *name, void *begin_addr, rt_size_t size)
 
 RTM_EXPORT (rt_smem_init)
 
rt_err_t rt_smem_detach (rt_smem_t m)
 
 RTM_EXPORT (rt_smem_detach)
 
void * rt_smem_alloc (rt_smem_t m, rt_size_t size)
 
 RTM_EXPORT (rt_smem_alloc)
 
void * rt_smem_realloc (rt_smem_t m, void *rmem, rt_size_t newsize)
 
 RTM_EXPORT (rt_smem_realloc)
 
void rt_smem_free (void *rmem)
 
 RTM_EXPORT (rt_smem_free)
 

宏定义说明

◆ DBG_TAG

#define DBG_TAG   "kernel.mem"

在文件 mem.c55 行定义.

◆ DBG_LVL

#define DBG_LVL   DBG_INFO

在文件 mem.c56 行定义.

◆ MIN_SIZE

#define MIN_SIZE   (sizeof(rt_uintptr_t) + sizeof(rt_size_t) + sizeof(rt_size_t))

在文件 mem.c85 行定义.

◆ MEM_MASK

#define MEM_MASK   ((~(rt_size_t)0) - 1)

在文件 mem.c87 行定义.

◆ MEM_USED

#define MEM_USED ( _mem)
值:
((((rt_uintptr_t)(_mem)) & MEM_MASK) | 0x1)
#define MEM_MASK
定义 mem.c:87
rt_base_t rt_uintptr_t

在文件 mem.c89 行定义.

◆ MEM_FREED

#define MEM_FREED ( _mem)
值:
((((rt_uintptr_t)(_mem)) & MEM_MASK) | 0x0)

在文件 mem.c90 行定义.

◆ MEM_ISUSED

#define MEM_ISUSED ( _mem)
值:
(((rt_uintptr_t)(((struct rt_small_mem_item *)(_mem))->pool_ptr)) & (~MEM_MASK))

在文件 mem.c91 行定义.

91#define MEM_ISUSED(_mem) \
92 (((rt_uintptr_t)(((struct rt_small_mem_item *)(_mem))->pool_ptr)) & (~MEM_MASK))

◆ MEM_POOL

#define MEM_POOL ( _mem)
值:
((struct rt_small_mem *)(((rt_uintptr_t)(((struct rt_small_mem_item *)(_mem))->pool_ptr)) & (MEM_MASK)))

在文件 mem.c93 行定义.

93#define MEM_POOL(_mem) \
94 ((struct rt_small_mem *)(((rt_uintptr_t)(((struct rt_small_mem_item *)(_mem))->pool_ptr)) & (MEM_MASK)))

◆ MEM_SIZE

#define MEM_SIZE ( _heap,
_mem )
值:
(((struct rt_small_mem_item *)(_mem))->next - ((rt_uintptr_t)(_mem) - \
(rt_uintptr_t)((_heap)->heap_ptr)) - RT_ALIGN(sizeof(struct rt_small_mem_item), RT_ALIGN_SIZE))
#define RT_ALIGN(size, align)

在文件 mem.c95 行定义.

95#define MEM_SIZE(_heap, _mem) \
96 (((struct rt_small_mem_item *)(_mem))->next - ((rt_uintptr_t)(_mem) - \
97 (rt_uintptr_t)((_heap)->heap_ptr)) - RT_ALIGN(sizeof(struct rt_small_mem_item), RT_ALIGN_SIZE))

◆ MIN_SIZE_ALIGNED

#define MIN_SIZE_ALIGNED   RT_ALIGN(MIN_SIZE, RT_ALIGN_SIZE)

在文件 mem.c99 行定义.

◆ SIZEOF_STRUCT_MEM

#define SIZEOF_STRUCT_MEM   RT_ALIGN(sizeof(struct rt_small_mem_item), RT_ALIGN_SIZE)

在文件 mem.c100 行定义.

函数说明

◆ RTM_EXPORT() [1/2]

RTM_EXPORT ( rt_smem_init )

引用了 rt_smem_init().

+ 函数调用图:

◆ RTM_EXPORT() [2/2]

RTM_EXPORT ( rt_smem_detach )

引用了 rt_smem_detach().

+ 函数调用图: