Flex  0.17.9
Classes | Namespaces | Macros | Enumerations | Functions
mmap_array.h File Reference
#include <assert.h>
#include <atomic>
#include <filesystem>
#include <string>
#include <string_view>
#include "flex/storages/rt_mutable_graph/file_names.h"
#include "glog/logging.h"
#include "grape/util.h"
Include dependency graph for mmap_array.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  gs::mmap_array< T >
 
struct  gs::string_item
 
class  gs::mmap_array< std::string_view >
 

Namespaces

 gs
 

Macros

#define ADDR   (void*) (0x0UL)
 
#define FLAGS   (MAP_PRIVATE | MAP_ANONYMOUS | MAP_HUGETLB)
 
#define PROTECTION   (PROT_READ | PROT_WRITE)
 
#define HUGEPAGE_SIZE   (2UL * 1024 * 1024)
 
#define HUGEPAGE_MASK   (2UL * 1024 * 1024 - 1UL)
 
#define ROUND_UP(size)   (((size) + HUGEPAGE_MASK) & (~HUGEPAGE_MASK))
 

Enumerations

enum  gs::MemoryStrategy { gs::MemoryStrategy::kSyncToFile, gs::MemoryStrategy::kMemoryOnly, gs::MemoryStrategy::kHugepagePrefered }
 

Functions

void * allocate_hugepages (size_t size)
 
size_t hugepage_round_up (size_t size)
 

Macro Definition Documentation

◆ ADDR

#define ADDR   (void*) (0x0UL)

Copyright 2020 Alibaba Group Holding Limited.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

◆ FLAGS

#define FLAGS   (MAP_PRIVATE | MAP_ANONYMOUS | MAP_HUGETLB)

◆ HUGEPAGE_MASK

#define HUGEPAGE_MASK   (2UL * 1024 * 1024 - 1UL)

◆ HUGEPAGE_SIZE

#define HUGEPAGE_SIZE   (2UL * 1024 * 1024)

◆ PROTECTION

#define PROTECTION   (PROT_READ | PROT_WRITE)

◆ ROUND_UP

#define ROUND_UP (   size)    (((size) + HUGEPAGE_MASK) & (~HUGEPAGE_MASK))

Function Documentation

◆ allocate_hugepages()

void* allocate_hugepages ( size_t  size)
inline

◆ hugepage_round_up()

size_t hugepage_round_up ( size_t  size)
inline