Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在 Windows 中,对于要求非常高的应用程序,程序员可以使用 HeapCreate、HeapAlloc 来更好地管理和控制内存分配——加速它(又名私有分配器)。Linux c++ 编程中的等价物是什么?
如果您想使用自己的私有分配器,然后使用mmap()将一定量的内存映射到您的进程中,那么您可以随意使用该内存。打开文件描述符/dev/zero,然后将其用作 'fildes' 参数mmap()。有关man mmap要传递的参数的完整详细信息,请参阅。在这方面mmap()扮演着同样的角色HeapCreate()。
mmap()
/dev/zero
man mmap
HeapCreate()