Memory module

Contents

Memory management utilities.

Files

file bn_alignment.h
file bn_config_ewram.h
file bn_config_memory.h
file bn_ewram_wait_state.h
file bn_memory.h

Namespaces

namespace bn
Main Butano namespace.
namespace bn::memory
Memory related functions.

Functions

template<int Bytes>
auto aligned(const void* pointer) -> bool constexpr
Indicates if the given pointer is aligned to the given Bytes.
template<int Bytes, typename Type>
auto aligned(const Type& reference) -> bool constexpr
Indicates if the given reference to a Type object is aligned to the given Bytes.

Defines

#define BN_CFG_EWRAM_WAIT_STATE
#define BN_CFG_MEMORY_MAX_EWRAM_ALLOC_ITEMS
#define BN_EWRAM_WAIT_STATE_2
#define BN_EWRAM_WAIT_STATE_1

Function documentation

template<int Bytes>
bool aligned(const void* pointer) constexpr

Indicates if the given pointer is aligned to the given Bytes.

template<int Bytes, typename Type>
bool aligned(const Type& reference) constexpr

Indicates if the given reference to a Type object is aligned to the given Bytes.

Define documentation

#define BN_CFG_EWRAM_WAIT_STATE

Specifies EWRAM access time in clock cycles.

Values not specified in BN_EWRAM_WAIT_STATE_* macros are not allowed.

#define BN_CFG_MEMORY_MAX_EWRAM_ALLOC_ITEMS

Specifies the maximum number of memory blocks that can be allocated in EWRAM with bn::malloc, bn::memory::ewram_alloc and the new operator.

#define BN_EWRAM_WAIT_STATE_2

EWRAM access time is 2+1 clock cycles for sequential accesses.

#define BN_EWRAM_WAIT_STATE_1

EWRAM access time is 1+1 clock cycles for sequential accesses.

This wait states setting is not supported by the GBA Micro. Enabling it will not crash the GBA Micro though, it will just fall back to BN_EWRAM_WAIT_STATE_2.