DDNet documentation
Toggle main menu visibility
Loading...
Searching...
No Matches
mem.h
Go to the documentation of this file.
1
/* (c) Magnus Auvinen. See licence.txt in the root of the distribution for more information. */
2
/* If you are missing that file, acquire a complete release at teeworlds.com. */
3
4
#ifndef BASE_MEM_H
5
#define BASE_MEM_H
6
7
#include <cstdint>
8
#include <cstring>
9
#include <type_traits>
10
16
30
void
mem_copy
(
void
*dest,
const
void
*source,
size_t
size);
31
45
void
mem_move
(
void
*dest,
const
void
*source,
size_t
size);
46
55
template
<
typename
T>
56
inline
void
mem_zero
(T *block,
size_t
size)
57
{
58
static_assert
((std::is_trivially_constructible<T>::value && std::is_trivially_destructible<T>::value) || std::is_fundamental<T>::value);
59
memset(block, 0, size);
60
}
61
75
int
mem_comp
(
const
void
*a,
const
void
*b,
size_t
size);
76
87
bool
mem_has_null
(
const
void
*block,
size_t
size);
88
99
bool
mem_is_null
(
const
void
*block,
size_t
size);
100
101
#endif
mem_zero
void mem_zero(T *block, size_t size)
Definition
mem.h:56
mem_copy
void mem_copy(void *dest, const void *source, size_t size)
Definition
mem.cpp:6
mem_has_null
bool mem_has_null(const void *block, size_t size)
Definition
mem.cpp:21
mem_is_null
bool mem_is_null(const void *block, size_t size)
Definition
mem.cpp:34
mem_move
void mem_move(void *dest, const void *source, size_t size)
Definition
mem.cpp:11
mem_comp
int mem_comp(const void *a, const void *b, size_t size)
Definition
mem.cpp:16
src
base
mem.h
Generated by
1.18.0