A C++ template library for embedded applications
Designed and maintained by
Aster Consulting Ltd
Join the ETL community
MIT licensed

Memory Model

This header defines enumerations and type lookups for supporting various memory models for the ETL.
These allow template classes to use optimally sized variables for the model.
For example, if a container will never have more than 255 elements then indexes and counts may be contained in 8 bit
variables.

memory_model
A user type that defines values for four different memory models.
MEMORY_MODEL_SMALL
MEMORY_MODEL_MEDIUM
MEMORY_MODEL_LARGE
MEMORY_MODEL_HUGE

Example
etl::memory_model::MEMORY_MODEL_LARGE

size_type_lookup

A type lookup template that defines a type that equates to the size type for memory model.

typedef typename etl::size_type_lookup<etl::memory_model::MEMORY_MODEL_LARGE>::type size_type;

The defined types are...
MEMORY_MODEL_SMALL   uint_least8_t
MEMORY_MODEL_MEDIUM  uint_least16_t
MEMORY_MODEL_LARGE   uint_least32_t
MEMORY_MODEL_HUGE    uint_least64_t
memory_model.h