Memory Manager

So i thought it would be fun to created a memory manager that has a simple common interface and provides tight packing, error checking, and wear leveling for unmanaged internal and external memory.

Currently I only have support for SecureMemory and RtcMemory, but I will be adding support for PIC Flash devices as i use those as well.

What’s ‘simple’ about the common interface is that it only supports built-in types and there is only 3 methods and one property to interact with memory.

public bool Recall(byte key, out object value)
public bool AddOrReplace(byte key, object value)
public bool Remove(byte key)
public uint Free()

The application only then needs to pass the key and remember what the value’s type was (which is only required since generics aren’t available)

Perhaps not something too many might need but here it is.
Library
Sample App

Id appreciate any suggestions to better the performance or resource use. I can imagine there’s some chance for optimization I do not realize.

2 Likes