Memory Milker



Memory Milker is a small library written in C. Its purpose is to make the most of a restricted amount of data memory (particularly useful for microcontrollers).

The Memory Milker library consists of functions for manipulating small "chunks" of memory.

A preprocessor directive is used to tell the Memory Milker library how many bits of memory is needed per "chunk".

Another preprocessor directive is used to tell the Memory Milker library how many "chunks" are needed.

You can set these directives and compile the library as follows:

gcc -c -D MEM_MILKER_BITS_PER_CHUNK=3 -D MEM_MILKER_QUANTITY_CHUNKS=64 mem_milker.c

The Memory Milker library exports the following functions for manipulating the memory chunks:

void SetChunk(uint_fast16_t const i, uint_fast8_t const state);
uint_fast8_t GetChunk(uint_fast16_t const i);
void SetEntireDataAllZeroes(void);
void SetEntireDataAllOnes(void);


The library consists of one source file and one header file:

mem_milker.h

mem_milker.c

Have fun.