IceShard
1
A personal game engine project, with development focused on 2D/2.5D games.
Toggle main menu visibility
Loading...
Searching...
No Matches
memsys
public
ice
mem_allocator_utils.hxx
Go to the documentation of this file.
1
3
4
#pragma once
5
#include <
ice/mem_allocator.hxx
>
6
7
namespace
ice
8
{
9
10
inline
auto
data_copy
(
ice::Allocator
&
alloc
,
ice::Data
data
)
noexcept
->
ice::Memory
11
{
12
if
(
data
.size == 0_B)
13
{
14
return
{};
15
}
16
17
ice::Memory
const
result =
alloc
.allocate({
data
.size,
data
.alignment });
18
if
(result.
location
!=
nullptr
)
19
{
20
ice::memcpy
(result,
data
);
21
}
22
return
result;
23
}
24
25
}
// namespace ice
mem_allocator.hxx
ice::data
Definition
span.hxx:129
ice
SPDX-License-Identifier: MIT.
Definition
array.hxx:12
ice::data_copy
auto data_copy(ice::Allocator &alloc, ice::Data data) noexcept -> ice::Memory
Definition
mem_allocator_utils.hxx:10
ice::alloc
auto alloc(ice::usize size) noexcept -> ice::AllocResult
ice::Allocator
ice::AllocatorBase< ice::build::is_debug||ice::build::is_develop > Allocator
Definition
mem_types.hxx:25
ice::memcpy
auto memcpy(void *dest, void const *source, ice::usize size) noexcept -> void *
ice::Data
Definition
mem_data.hxx:17
ice::Memory
Definition
mem_memory.hxx:13
ice::Memory::location
void * location
Definition
mem_memory.hxx:14
Generated by
1.18.0