TuyaOS
宏定义 | 函数
tal_memory.h 文件参考

Common process - adapter the memory api provide by OS 更多...

#include "tuya_cloud_types.h"
tal_memory.h 的引用(Include)关系图:
此图展示该文件直接或间接的被哪些文件引用了:

浏览源代码.

宏定义

#define Calloc(req_count, req_size)   tal_calloc(req_count, req_size)
 malloc consecutive memory, the size is reqCount*reqSize 更多...
 
#define Free(ptr)   tal_free(ptr)
 free memory 更多...
 
#define Malloc(req_size)   tal_malloc(req_size)
 malloc memory 更多...
 

函数

VOID_T * tal_calloc (SIZE_T nitems, SIZE_T size)
 Allocate and clear the memory 更多...
 
VOID_T tal_free (VOID_T *ptr)
 Free memory of system 更多...
 
VOID_T * tal_malloc (SIZE_T size)
 Alloc memory of system 更多...
 
VOID_T * tal_realloc (VOID_T *ptr, SIZE_T size)
 Re-allocate the memory 更多...
 
INT_T tal_system_memcmp (CONST VOID_T *str1, CONST VOID_T *str2, SIZE_T n)
 Compare the first n bytes of store str1 and store str2 更多...
 
VOID_T * tal_system_memcpy (VOID_T *dst, CONST VOID_T *src, SIZE_T n)
 Alloc memory of system 更多...
 
VOID_T * tal_system_memset (VOID_T *src, INT_T ch, SIZE_T n)
 set memory 更多...
 
SIZE_T tal_system_strlen (CONST CHAR_T *str)
 

详细描述

Common process - adapter the memory api provide by OS

版本
0.1
日期
2021-08-24

宏定义说明

◆ Calloc

#define Calloc (   req_count,
  req_size 
)    tal_calloc(req_count, req_size)

malloc consecutive memory, the size is reqCount*reqSize

参数
[in]reqCountthe required memory count
[in]reqSizethe required memory szie
返回
NULL on failed, others on the address of the memory

◆ Free

#define Free (   ptr)    tal_free(ptr)

free memory

参数
[in]pReqMemthe memory address which got from Malloc or Calloc function
返回
VOID

◆ Malloc

#define Malloc (   req_size)    tal_malloc(req_size)

malloc memory

参数
[in]reqSizethe required memory size
返回
NULL on failed, others on the address of the memory

函数说明

◆ tal_calloc()

VOID_T * tal_calloc ( SIZE_T  nitems,
SIZE_T  size 
)

Allocate and clear the memory

参数
[in]nitemsthe numbers of memory block
[in]sizethe size of the memory block
返回
the memory address calloced

◆ tal_free()

VOID_T tal_free ( VOID_T *  ptr)

Free memory of system

参数
[in]ptrmemory point
注解
This API is used to free memory of system.
返回
VOID_T

◆ tal_malloc()

VOID_T * tal_malloc ( SIZE_T  size)

Alloc memory of system

参数
[in]sizememory size
注解
This API is used to alloc memory of system.
返回
the memory address malloced

◆ tal_realloc()

VOID_T * tal_realloc ( VOID_T *  ptr,
SIZE_T  size 
)

Re-allocate the memory

参数
[in]nitemssource memory address
[in]sizethe size after re-allocate
返回
VOID_T

◆ tal_system_memcmp()

INT_T tal_system_memcmp ( CONST VOID_T *  str1,
CONST VOID_T *  str2,
SIZE_T  n 
)

Compare the first n bytes of store str1 and store str2

参数
[in]str1point to string1
[in]str2point to string2
[in]nfirst n bytes
注解
This API is used to compare two strings
返回
value < 0: str1 is less than str2; value > 0: str1 is greater than str2; value = 0: str1 is equal to str2;

◆ tal_system_memcpy()

VOID_T * tal_system_memcpy ( VOID_T *  dst,
CONST VOID_T *  src,
SIZE_T  n 
)

Alloc memory of system

参数
[in]sizememory size
注解
This API is used to alloc memory of system.
返回
the memory address malloced

◆ tal_system_memset()

VOID_T * tal_system_memset ( VOID_T *  src,
INT_T  ch,
SIZE_T  n 
)

set memory

参数
[in]sizememory size
注解
This API is used to alloc memory of system.
返回
the memory address malloced

◆ tal_system_strlen()

SIZE_T tal_system_strlen ( CONST CHAR_T *  str)
参数
[in]str
注解
返回