📄 hal_malloc.3hal
字号:
.TH hal_malloc "3hal" "2006-10-12" "EMC Documentation" "HAL".SH NAMEhal_malloc \- Allocate space in the HAL shared memory area.SH SYNTAX.HP void *hal_malloc(long int \fIsize\fR).SH ARGUMENTS.IP \fIsize\fRGives the size, in bytes, of the block.SH DESCRIPTION\fBhal_malloc\fR allocates a block of memory from the main HAL shared memory area.It should be used by all components to allocate memory for HAL pins andparameters. It allocates `size' bytes, and returns a pointer to the allocatedspace, or NULL (0) on error. The returned pointer will be properly aligned forany type HAL supports. A component should allocate during initialization allthe memory it needs.The allocator is very simple, and there is no `free'. The entire HAL sharedmemory area is freed when the last component calls \fBhal_exit\fR. This meansthat if you continuously install and remove one component while othercomponents are present, you eventually will fill up the shared memory and aninstall will fail. Removing all components completely clears memory and youstart fresh..SH RETURN VALUEA pointer to the allocated space, which is properly aligned for any variableHAL supports. Returns NULL on error.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -