Skip to content

Commit cf3942e

Browse files
committed
Update README
1 parent 92cc624 commit cf3942e

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

README.md

+8-5
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ To be simple and fast, when it allocate a buffer it will never use the buffer ag
2121
1000, // shared memory max size
2222
true); // reset shared memory flag
2323
24-
TestNode* buffer = (TestNode*)shm.Allocate(50); // allocate memory just like malloc
24+
TestNode* buffer = (TestNode*)shm.Allocate(sizeof(TestNode)); // allocate memory just like malloc
2525
~~~~
2626

2727

@@ -45,10 +45,13 @@ Easy to use is the most important !
4545
#include "container/shm_manager.h"
4646
#include "container/lockfree_skiplist.h"
4747
48-
area::ShmArea area = area::ShmArea("test_shared_memory_dat", 10000000, true);
49-
// shm_manager for conatiner just for the interface can be easy to use
50-
container::ShmManager* shm_manager = new container::ShmManager(&area);
51-
container::LockFreeSkipList<int> list(shm_manager, true);
48+
auto area = area::ShmArea("test_shared_memory_dat",
49+
10000000,
50+
true); // If you want to open from exist memory, just pass false
51+
52+
auto* shm_manager = new container::ShmManager(&area);
53+
54+
container::LockFreeSkipList<int> list(shm_manager, true); // If you want to open from exist skiplist, just pass false
5255
5356
for (int i=0; i<20000; ++i) {
5457
list.Add(i);

0 commit comments

Comments
 (0)