Solid Fluid System Solutions  
Home Software About Hardware Firmware
Folder Icon MemMgr
 
Our ANSI style memory management module.

Document Icon VCore (Library)
Current Document Icon Memory Manager
Document Icon Run-time Type
Document Icon Object Creation
Document Icon Constructor / Destructor
Document Icon Error Handling
Document Icon Verification
Document Icon Serialisation
Document Icon Synchronisation
Document Icon Thread Completion

MemMgr

The memory manager group is responsible for all aspects of heap allocation in Solid Fluid applications.

The detail of the memory management functionality is outlined in the adjacent folder. The memory management functionality is exposed at the global level as simple _cdecl functions;

  • vmalloc()
  • vrealloc()
  • vfree()

The naming scheme for our global memory management functions was chosen to avoid a conflict with the C standard library memory allocation routines in circumstances where it is impossible to avoid using a second memory manager. Clearly it would still be possible to use namespaces to achieve this end, but this does not seem desirable.

Whilst is is quite possible to use two different memory managers in the same application, it is obviously not recommended as a design approach. There are some circumstances where use of more than one memory manager is unavoidable. Such circumstances would typically be where the programmer of an imported library/module has comprehensively used a non-native memory manager througout their code. Perhaps it is impossible to change every call in that code to a different memory manager. This could easily occur where some of the functionality is only available as object code, and no mechanism has been provided to retarget that object code to a different memory manager.

Our experiences with open source software has generally been good. As well as having the source code available, there is usually no need to modify it directly because the code actually calls external memory management functions with a unique naming scheme. Such functions can be used by the user and make mappping to any memory manager easily possible.

The VCore memory management functions described are, in fact, _cdecl calls that reference an underlying class (_thiscall). These _cdecl calls could be consisdered for most purposes to be our external C memory management functions, since all of our code references just these _cdecl calls.

The base class of all our efforts (VObject) is also declared within this library. Operators new, new[], delete, and delete[], are all overloaded for the base class, and these reference the _cdecl calls described above.

Copyright © Solid Fluid 2007-2022
Last modified: SolFlu  Wed, 10 Jun 2009 01:12:03 GMT