Lib Sub-System: Memory

01 The Semys Library contains a few simple wrapper functions for memory handling.
02 The memory wrapper functions have been added for the following reasons:
  • Clear Memory: Every memory byte allocated is initialized with the constant 0x00.
  • Leak Detection: In the debug build, during shutdown a list of memory leaks is traced.
  • Abstraction: Memory allocation is 'environment' specific. While malloc() and free() are pretty much standard at most places, there are environments where they are not that similar.
  • Layer Exchange: Although a more theoretical idea, some people sometimes prefer an own memory allocator that allocates from a pre-allocated blob. This would be possible as well. (Note that this has not been envisioned, but adoption would be easy)
03

It is an old habit of mine to erase all structural data with 0x00. Other people prefer to set all members one by one to the constant 0. Just another style of programming.
But before I forget setting one of the members (and wonder about bogus data) I have all memory automatically erased. Plus, higher languages (C#, Java, ...) have this anyway.

04 Functions:
05 Reference: SemysMemory.h
Implementation: Semys Library

Goto: Main Page; This page is part of the Semys software documentation. See About: Documentation for details.