Открыть боковую панель
CircuitGen
CircuitGen_Graph
Коммиты
eb864c67
Коммит
eb864c67
создал
Янв 16, 2025
по автору
Fuuulkrum7
Просмотр файлов
Fix spelling
владелец
96827d45
Изменения
1
Скрыть пробелы
Построчно
Рядом
include/CircuitGenGraph/GraphMemory.hpp
Просмотр файла @
eb864c67
...
...
@@ -13,14 +13,14 @@ typedef unsigned char bytea;
/// @author Fuuulkrum7
/// @brief This is a custom allocator, which allocates firstly `buf_size`
/// bytes, and than, if requires, allocates additionaly `chunk_size` bytes.
/// bytes, and than, if requires, allocates additional
l
y `chunk_size` bytes.
/// Pointers on all allocated blocks are stored in a vector, so, if it is
/// possible, calculate buf_size correctly to reduce time for deallocation
struct
MultiLinearAllocator
{
// clang-format off
/// @brief buf_size should be more than 128 bytes,
/// as the bigest vertex has such size
/// as the big
g
est vertex has such size
/// @param buf_size size for the first allocation
/// @param chunk_size size for further allocations (usually is less
/// than `buf_size` value)
...
...
@@ -86,7 +86,7 @@ private:
/// @brief all pinters on memory blocks, which have been allocated
std
::
vector
<
bytea
*>
blocks
;
/// @brief pointer on position, from which allocation should be started (from
/// `off
e
st` to `offset + sizeof(T)`)
/// `offs
e
t` to `offset + sizeof(T)`)
bytea
*
offset
;
/// @brief size of the first buffer
size_t
buf_size
;
...
...
@@ -95,10 +95,10 @@ private:
};
/// @author Fuuulkrum7
/// @brief This class is used for memory managment. It has a
/// `MultiLinearAllocator` for allocating memory for graph vertic
i
es and
/// monotonic_buffer_resource, wh
c
ih is used for memory allocation for set of
/// strings, where all vert
ex
es names are stored.
/// @brief This class is used for memory manag
e
ment. It has a
/// `MultiLinearAllocator` for allocating memory for graph vertices and
/// monotonic_buffer_resource, whi
c
h is used for memory allocation for set of
/// strings, where all vert
ic
es names are stored.
class
GraphMemory
{
public:
// clang-format off
...
...
@@ -148,11 +148,11 @@ public:
}
private:
/// @brief allocator for vertic
i
es
/// @brief allocator for vertices
MultiLinearAllocator
d_vertexMemory
;
/// @brief resource for memory set without deallocations
std
::
pmr
::
monotonic_buffer_resource
d_stringMemory
;
/// @brief set with all vertic
i
es names
/// @brief set with all vertices names
std
::
pmr
::
set
<
std
::
string
>
d_strings
;
};
Редактирование
Предварительный просмотр
Поддерживает Markdown
0%
Попробовать снова
или
прикрепить новый файл
.
Отмена
You are about to add
0
people
to the discussion. Proceed with caution.
Сначала завершите редактирование этого сообщения!
Отмена
Пожалуйста,
зарегистрируйтесь
или
войдите
чтобы прокомментировать