libcopp
2.3.1
Loading...
Searching...
No Matches
include
libcopp
stack
allocator
stack_allocator_memory.h
Go to the documentation of this file.
1
// Copyright 2023 owent
2
3
#pragma once
4
5
#include <libcopp/utils/config/libcopp_build_features.h>
6
7
#include <
libcopp/utils/features.h
>
8
9
#include <cstddef>
10
11
#ifdef LIBCOPP_HAS_ABI_HEADERS
12
# include LIBCOPP_ABI_PREFIX
13
#endif
14
15
LIBCOPP_COPP_NAMESPACE_BEGIN
16
struct
stack_context
;
17
18
namespace
allocator
{
19
24
class
LIBCOPP_COPP_API
stack_allocator_memory
{
25
private
:
26
void
*
start_ptr_
;
27
std::size_t
memory_size_
;
28
bool
is_used_
;
29
30
public
:
31
stack_allocator_memory
() LIBCOPP_MACRO_NOEXCEPT;
37
stack_allocator_memory
(
void
*start_ptr,
std
::
size_t
max_size) LIBCOPP_MACRO_NOEXCEPT;
38
stack_allocator_memory
(
stack_allocator_memory
&other) LIBCOPP_MACRO_NOEXCEPT;
39
stack_allocator_memory
(
stack_allocator_memory
&&other) LIBCOPP_MACRO_NOEXCEPT;
40
~
stack_allocator_memory
();
41
42
stack_allocator_memory
&operator=(
stack_allocator_memory
&other) LIBCOPP_MACRO_NOEXCEPT;
43
stack_allocator_memory
&operator=(
stack_allocator_memory
&&other) LIBCOPP_MACRO_NOEXCEPT;
44
void
swap(
stack_allocator_memory
&other);
45
52
void
attach(
void
*start_ptr,
std
::
size_t
max_size) LIBCOPP_MACRO_NOEXCEPT;
53
60
void
allocate(
stack_context
&ctx,
std
::
size_t
size) LIBCOPP_MACRO_NOEXCEPT;
61
66
void
deallocate(
stack_context
&ctx) LIBCOPP_MACRO_NOEXCEPT;
67
};
68
}
// namespace allocator
69
LIBCOPP_COPP_NAMESPACE_END
70
71
#ifdef LIBCOPP_HAS_ABI_HEADERS
72
# include LIBCOPP_ABI_SUFFIX
73
#endif
allocator::stack_allocator_memory
memory allocator this allocator will return address of specified memory section
Definition
stack_allocator_memory.h:24
allocator::stack_allocator_memory::memory_size_
std::size_t memory_size_
Definition
stack_allocator_memory.h:27
allocator::stack_allocator_memory::start_ptr_
void * start_ptr_
Definition
stack_allocator_memory.h:26
allocator::stack_allocator_memory::is_used_
bool is_used_
Definition
stack_allocator_memory.h:28
features.h
allocator
Definition
stack_allocator_malloc.h:18
std
STL namespace.
stack_context
Definition
stack_context.h:18
Generated by
1.9.8