Is there a POSIX function equivalent to _malloc_r and _free_r from CYG开发者_StackOverflow中文版WIN? Is there a POSIX reentrant library?
Please advice.
Many thanks.
No, and for good reason. Demanding reentrancy of malloc, even if only for special _r functions, would impose massive performance costs and likely precludes many high-performance implementations to begin with. Why do you need reentrancy? If you're trying to allocate memory from a signal handler, you might use mmap, but a better approach would be moving as much code as possible out of the signal handler and using the signal handler itself only to set a flag that will get picked up by another part of your program after the signal handler returns.
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论