Skip to content

apfeltee/memorymapped

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MemoryMapped

... is a thin wrapper around memory-mapping facilities.
Specifically, mmap on Linux, and CreateFileMapping on Windows.

Example:

MemoryMapped::File fh("thing");

// loop over mapped data ...
for(size_t i=0; i<fh.size(); i++)
{
    do_something_with(fh[i]);
}

// or use the chunk directly
std::cout.write(fh.data(), fh.size());

// MemoryMapped knows about RAII, but you're a nice programmer who wouldn't
// just leave memory chunks hanging around. Right?
fh.close();

See also test.cpp, which accepts a single argument as file and open/read/prints it.

About

A wrapper around mmap (Linux) / CreateFileMapping (win32)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published