Review comments

This commit is contained in:
Rajkumar 2021-12-22 13:39:45 -08:00
parent afe9e6a325
commit a75d3d1c83
2 changed files with 7 additions and 5 deletions

View File

@ -1,8 +1,12 @@
#include <base/getPageSize.h>
#include <unistd.h>
#include <cstdlib>
Int64 getPageSize()
{
return sysconf(_SC_PAGESIZE);
Int64 page_size = sysconf(_SC_PAGESIZE);
if(page_size == -1)
abort();
else
return sysconf(_SC_PAGESIZE);
}

View File

@ -33,12 +33,10 @@ public:
/// Current value is just enough for all tests in our CI. It's not selected in some special
/// way. We will have 40 pages with 4KB page size.
static constexpr size_t default_stack_size = 192 * 1024; /// 64KB was not enough for tests
static constexpr size_t default_page_size = 4096;
explicit FiberStack(size_t stack_size_ = default_stack_size) : stack_size(stack_size_)
{
ssize_t tmp_page_size = getPageSize();
page_size = (tmp_page_size == -1) ? default_page_size : tmp_page_size;
page_size = getPageSize();
}
boost::context::stack_context allocate()