blob: 29312a7a8b19bdb80bd0aa7759c21fa52f5ee66a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
#include <malloc.h>
#include <sys/mman.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdio.h>
#include <errno.h>
#include <string.h>
#include <unistd.h>
#include <stdlib.h>
#include <iostream>
#include "mempool.hpp"
int main() {
MemPool ram(4096);
MemPool file(4096, "myfunnymmapfile");
MemPool file2(4096, "myfunnymmapfile2");
ram.sync();
file.sync();
char *s = (char*) "Ei der Daus!";
memcpy(ram(), s, strlen(s));
memcpy(file(), ram(), 4096);
}
|