aports/testing/bobcat/dont-use-reserved-name-for-page-size.patch
Shiz 31f4e002d0 testing/bobcat: new aport
https://fbb-git.github.io/bobcat/
library of C++ classes and templates handling child processes, streams/sockets,
shared memory, config files, etc.
2017-05-06 14:56:13 +02:00

35 lines
1.2 KiB
Diff

--- 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