ScummVM API documentation

Description

Functions for managing the memory.

Modules

 Memory pool
 API for managing the memory pool.
 

Functions

void Common::memset16 (uint16 *dst, uint16 val, size_t count)
 
void Common::memset32 (uint32 *dst, uint32 val, size_t count)
 
void Common::memset64 (uint64 *dst, uint64 val, size_t count)
 
template<class In , class Type >
Type * Common::uninitialized_copy (In first, In last, Type *dst)
 
template<class In , class Type >
Type * Common::uninitialized_move (In first, In last, Type *dst)
 
template<class Type , class Value >
void Common::uninitialized_fill_n (Type *dst, size_t n, const Value &x)
 

Function Documentation

◆ memset16()

void Common::memset16 ( uint16 *  dst,
uint16  val,
size_t  count 
)

Fills memory [dst, dst + count) with the value val.

This is a replacement function for Common::fill, using an unrolled loop to maximize performance on most architectures.

This fill operation is extensively used throughout the graphics code, so this counts as one of the main bottlenecks. Please replace it with assembly when possible!

Note that pointers passed to these functions must be aligned correctly.

◆ uninitialized_copy()

template<class In , class Type >
Type* Common::uninitialized_copy ( In  first,
In  last,
Type *  dst 
)

Copies data from the range [first, last) to [dst, dst + (last - first)). It requires the range [dst, dst + (last - first)) to be valid and uninitialized.

◆ uninitialized_move()

template<class In , class Type >
Type* Common::uninitialized_move ( In  first,
In  last,
Type *  dst 
)

Moves data from the range [first, last) to [dst, dst + (last - first)). It requires the range [dst, dst + (last - first)) to be valid and uninitialized.

◆ uninitialized_fill_n()

template<class Type , class Value >
void Common::uninitialized_fill_n ( Type *  dst,
size_t  n,
const Value x 
)

Initializes the memory [first, first + (last - first)) with the value x. It requires the range [first, first + (last - first)) to be valid and uninitialized. Initializes the memory [dst, dst + n) with the value x. It requires the range [dst, dst + n) to be valid and uninitialized.