31 ceiling_msg_size_ = GetCeilingMessageSize(real_msg_size);
32 block_buf_size_ = GetBlockBufSize(ceiling_msg_size_);
33 block_num_ = GetBlockNum(ceiling_msg_size_);
34 managed_shm_size_ = EXTRA_SIZE + STATE_SIZE + \
35 (BLOCK_SIZE + block_buf_size_) * block_num_ + \
39const uint64_t ShmConf::EXTRA_SIZE = 1024 * 4;
40const uint64_t ShmConf::STATE_SIZE = 1024;
41const uint64_t ShmConf::BLOCK_SIZE = 1024;
42const uint64_t ShmConf::MESSAGE_INFO_SIZE = 1024;
47const uint32_t ShmConf::BLOCK_NUM_16K = 512;
48const uint64_t ShmConf::MESSAGE_SIZE_16K = 1024 * 16;
50const uint32_t ShmConf::BLOCK_NUM_128K = 128;
51const uint64_t ShmConf::MESSAGE_SIZE_128K = 1024 * 128;
53const uint32_t ShmConf::BLOCK_NUM_1M = 64;
54const uint64_t ShmConf::MESSAGE_SIZE_1M = 1024 * 1024;
56const uint32_t ShmConf::BLOCK_NUM_8M = 32;
57const uint64_t ShmConf::MESSAGE_SIZE_8M = 1024 * 1024 * 8;
59const uint32_t ShmConf::BLOCK_NUM_16M = 16;
60const uint64_t ShmConf::MESSAGE_SIZE_16M = 1024 * 1024 * 16;
62const uint32_t ShmConf::BLOCK_NUM_MORE = 8;
63const uint64_t ShmConf::MESSAGE_SIZE_MORE = 1024 * 1024 * 32;
65uint64_t ShmConf::GetCeilingMessageSize(
const uint64_t& real_msg_size) {
67 if (real_msg_size <= MESSAGE_SIZE_16K) {
69 }
else if (real_msg_size <= MESSAGE_SIZE_128K) {
71 }
else if (real_msg_size <= MESSAGE_SIZE_1M) {
73 }
else if (real_msg_size <= MESSAGE_SIZE_8M) {
75 }
else if (real_msg_size <= MESSAGE_SIZE_16M) {
83uint64_t ShmConf::GetBlockBufSize(
const uint64_t& ceiling_msg_size) {
87uint32_t ShmConf::GetBlockNum(
const uint64_t& ceiling_msg_size) {
90 case MESSAGE_SIZE_16K:
93 case MESSAGE_SIZE_128K:
102 case MESSAGE_SIZE_16M:
105 case MESSAGE_SIZE_MORE:
106 num = BLOCK_NUM_MORE;
static const uint32_t ARENA_BLOCK_NUM
const uint64_t & ceiling_msg_size()
static const uint64_t ARENA_MESSAGE_SIZE
void Update(const uint64_t &real_msg_size)