blob: 3c3fb1a5fe0709e9176bf41bd0e6c7ef5a30474f (
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
27
28
29
30
31
32
33
34
35
|
--- a/sharedmemory/computesegmentsize.cc
+++ b/sharedmemory/computesegmentsize.cc
@@ -28,10 +28,10 @@
maxMemory <<= sizeUnit;
- double a = static_cast<double>(PAGESIZE) * PAGESIZE / sizeof(Entry);
+ double a = static_cast<double>(BC_PAGE_SIZE) * BC_PAGE_SIZE / sizeof(Entry);
double b = -static_cast<double>(sizeof(SharedSegment) - sizeof(Entry))
- * PAGESIZE / sizeof(Entry);
+ * BC_PAGE_SIZE / sizeof(Entry);
double c = -maxMemory;
@@ -39,7 +39,7 @@
ceil((-b + sqrt(b * b - 4 * a * c)) / (2 * a))
);
- size_t segmentSize = factor * PAGESIZE;
+ size_t segmentSize = factor * BC_PAGE_SIZE;
*nBlocks = (segmentSize - (sizeof(SharedSegment) - sizeof(Entry)))
/ sizeof(Entry);
--- a/sharedmemory/sharedmemory
+++ b/sharedmemory/sharedmemory
@@ -27,7 +27,7 @@
friend std::ostream &operator<<(std::ostream &out,
SharedMemory const &mem);
- enum { PAGESIZE = 1 << 12 };
+ enum { BC_PAGE_SIZE = 1 << 12 };
// updated by the non-default constructors.
int d_id = -1; // id of SharedSegment
|