mirror of
https://github.com/mongodb/mongo.git
synced 2024-12-01 01:21:03 +01:00
23 lines
356 B
C
23 lines
356 B
C
|
// mmap.h
|
||
|
|
||
|
#pragma once
|
||
|
|
||
|
class MemoryMappedFile {
|
||
|
public:
|
||
|
MemoryMappedFile();
|
||
|
~MemoryMappedFile();
|
||
|
|
||
|
/* 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;
|
||
|
};
|