What if the process was in the middle of allocating additional memory on its heap using malloc, and you call malloc from the signal handler?
如果当进程正在使用malloc在它的堆上分配额外的内存时,您通过信号处理器调用 malloc,那会怎样?
In the case of malloc, havoc can result for the process, because malloc usually maintains a linked list of all its allocated area and it may have been in the middle of changing this list.
如果是调用malloc,则进程会被严重破坏,因为malloc通常会为所有它所分配的区域维持一个链表,而它又可能正在修改那个链表。
When memory size is less than or equal to 512 bytes, AIX malloc provides a more efficient frontend to the actual backend functions of malloc.
对于小于或等于512字节的内存块,AIXmalloc为malloc的实际后端功能提供更高效的前端。
For example, a memory chunk allocated with malloc in Module 3 can be freed in Module 2 with free. It is because both malloc and free calls will end up in the same instance of CRT.
例如,模块3使用malloc所分配的一段内存空间可以由模块2释放,因为对malloc和free的调用都是由同一个CRT对象实现的。
For example, a memory chunk allocated with malloc in Module 3 can be freed in Module 2 with free. It is because both malloc and free calls will end up in the same instance of CRT.
例如,模块3使用malloc所分配的一段内存空间可以由模块2释放,因为对malloc和free的调用都是由同一个CRT对象实现的。
应用推荐