tesseract++ 0.0.1
N-dimensional tensor library for embedded systems
Loading...
Searching...
No Matches
Namespaces | Functions
mem_utils.h File Reference

STL-free memory utilities. More...

#include "config.h"
#include "simple_type_traits.h"
Include dependency graph for mem_utils.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  detail
 

Functions

void detail::memset (void *ptr, int value, my_size_t size) noexcept
 Fill a block of memory with a byte value.
 
void detail::memcpy (void *dst, const void *src, my_size_t size) noexcept
 Copy a block of memory.
 
template<typename T >
void fill_n_optimized (T *ptr, my_size_t count, const T &value)
 Fill a contiguous buffer with a given value.
 
template<typename T >
void copy_n_optimized (const T *src, T *dst, my_size_t count)
 Copy elements from a source buffer to a destination buffer.
 

Detailed Description

STL-free memory utilities.

Function Documentation

◆ copy_n_optimized()

template<typename T >
void copy_n_optimized ( const T *  src,
T *  dst,
my_size_t  count 
)
inline

Copy elements from a source buffer to a destination buffer.

For POD types, delegates to detail::memcpy for optimal codegen. Falls back to an element-wise loop otherwise.

Template Parameters
TElement type.
Parameters
srcPointer to the source buffer.
dstPointer to the destination buffer.
countNumber of elements to copy.
Here is the call graph for this function:

◆ fill_n_optimized()

template<typename T >
void fill_n_optimized ( T *  ptr,
my_size_t  count,
const T &  value 
)
inline

Fill a contiguous buffer with a given value.

For POD types initialized to zero, delegates to detail::memset for optimal codegen. Falls back to a scalar loop otherwise.

Template Parameters
TElement type.
Parameters
ptrPointer to the start of the buffer.
countNumber of elements to fill.
valueValue to assign to each element.
Here is the call graph for this function: