Common process - adapter the memory api provide by OS
更多...
#include "tuya_cloud_types.h"
浏览源代码.
Common process - adapter the memory api provide by OS
- 版本
- 0.1
- 日期
- 2021-08-24
- 版权所有
- Copyright 2021-2031 Tuya Inc. All Rights Reserved.
◆ Calloc
| #define Calloc |
( |
|
req_count, |
|
|
|
req_size |
|
) |
| tal_calloc(req_count, req_size) |
malloc consecutive memory, the size is reqCount*reqSize
- 参数
-
| [in] | reqCount | the required memory count |
| [in] | reqSize | the required memory szie |
- 返回
- NULL on failed, others on the address of the memory
◆ Free
free memory
- 参数
-
| [in] | pReqMem | the memory address which got from Malloc or Calloc function |
- 返回
- VOID
◆ Malloc
malloc memory
- 参数
-
| [in] | reqSize | the 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] | nitems | the numbers of memory block |
| [in] | size | the size of the memory block |
- 返回
- the memory address calloced
◆ tal_free()
| VOID_T tal_free |
( |
VOID_T * |
ptr | ) |
|
Free memory of system
- 参数
-
- 注解
- This API is used to free memory of system.
- 返回
- VOID_T
◆ tal_malloc()
| VOID_T * tal_malloc |
( |
SIZE_T |
size | ) |
|
Alloc memory of system
- 参数
-
- 注解
- 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] | nitems | source memory address |
| [in] | size | the size after re-allocate |
- 返回
- VOID_T