在windows平台上是否有一个内存映射api,就像linux上的mmap()一样?

前端之家收集整理的这篇文章主要介绍了在windows平台上是否有一个内存映射api,就像linux上的mmap()一样?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
有没有api做内存映射,就像
mmap()

在linux上?

File mapping

File mapping is the association of a file’s contents with a portion of the virtual address space of a process. The system creates a file mapping object (also known as a section object) to maintain this association. A file view is the portion of virtual address space that a process uses to access the file’s contents. File mapping allows the process to use both random input and output (I/O) and sequential I/O. It also allows the process to work efficiently with a large data file,such as a database,without having to map the whole file into memory. Multiple processes can also use memory-mapped files to share data.

Processes read from and write to the file view using pointers,just as they would with dynamically allocated memory. The use of file mapping improves efficiency because the file resides on disk,but the file view resides in memory. Processes can also manipulate the file view with the VirtualProtect function.

原文链接:https://www.f2er.com/windows/372773.html

猜你在找的Windows相关文章