0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-12-01 09:32:32 +01:00
mongodb/util/mmap.h

25 lines
409 B
C
Raw Normal View History

2008-06-06 15:43:15 +02:00
// mmap.h
#pragma once
class MemoryMappedFile {
public:
static void closeAllFiles();
2008-06-06 15:43:15 +02:00
MemoryMappedFile();
~MemoryMappedFile(); /* closes the file if open */
void close();
2008-06-06 15:43:15 +02:00
/* only smart enough right now to deal with files of a fixed length.
creates if DNE
*/
void* map(const char *filename, int length);
void flush(bool sync);
private:
HANDLE fd;
HANDLE maphandle;
void *view;
int len;
};