Home Products Contracting Purchase About Contact
Home Products Contracting Purchase About Contact
VMem VMem

Version History

06/01/20142.1 - Improved memory integrity checking.
-Memory corruption asserts now report address and value of the corruption
-added memset integrity checks. These checks catch many more memory corruptions. Memory is checked when it is allocated or coalesced and in the integrity checking.
-Added more corruption asserts
-Now checks integrity on global teardown
-fixed memsetting in CoalesceHeap when VMEM_MEMSET_ONLY_SMALL is defined
-General tidyup, all memory checking now uses new CehckMemory function. Removed VMAx function.
-added DEBUG define debug config in Linux makefile and codeblocks project
-fixed some warnings in 64bit config
-added non-clean shutdown option (only used for assert functional tests)
-re-wrote VirtualMemImp::TryCommit. Now simpler and easier to understand.
-added automated tests for all configs
-added the ability to set your own Log callback function
-changed VMEM_START_MULTI_LINE_MACRO. Now faster in Debug builds.
-changed DEBUG_LEVEL define to be VMEM_DEBUG_LEVEL and moved it in VMemDefs.hpp. Now only defined if not already defined.
-decommitted (but not actually decommitted due to delayed release) is now memset to DECOMMITTED_MEM (0xdededede)
-unused FSA pages are now mmeset to UNUSED_PAGE (0xaeaeaeae)
-fixed minor leak in VMemHashMap.hpp. It wouldn't release all of the memory when the map was resized. Would typically only leak a few K over an application lifetime.
-fixed reserved bytes stats bug if VMem::VirtualReserve failed due to lack of memory
-improved Test_VMemAlloc for more coverage. Added Test_VMemAlloc_Thread test. Added memory corruption assert tests

-Fixes for Unix/OSX port
-Unix platforms now use mmap/munmap to allocate memory instead of malloc, meaning that malloc can be overridden.
-makefile for gcc
-removed VMEM_RESERVE. It is now implied by VMEM_OS_WIN. It is not available on any othert platform
-removed OVERRIDE_MALLOC code and replaced with a comment
-fixed infinite loop that occurred if malloc was overridden with VMEM_DELAYED_RELEASE.
-enabled VMEM_DELAYED_RELEASE. After extensive testing it seems to be bug free.
-added static assert to catch the case where VMEM64 isn't defined no 64bit builds (and vice-versa)
-changed VMEM_ASSERT to stop on the asserted line
-changed VMEM_ASSERT to not product warnings in release. This required wrapping some asserts in VMEM_ASSERT_CODE so that they are not compiled in for release.
-VirtualMem now stores a hashmap of all allocs. This is needed so that it remembers the base address when an alloc has been aligned. It also means that sizes and alignments are no longer needed int he release functions.
-changed defines so that VMemCore.hpp is always included in every file (helps with static asserts)
-moved AddrKey class to VMemHashMap.hpp because it is now also used by VirtuamMem.cpp
-moved VMem includes out of the PCH file and moved the system headers into the PCH file
-fixed some cast warnings
-removed Thread::Sleep() because it wasn't being used
-fixed compile error in VMem::Thread::CreateThread on OSX
-removed debug code and compile warnings code from VMem_Test\main.cpp
-fixed Test_VirtualMemDelayedRelease to clean up after itself
-fixed some bugs with the stats. They were not exactly matching up after the recent changes.
-minor optimisations to VMemHashMap
-crash bug fix on gcc. Because enums are treated as signed integers in gcc, the CoalesceHeap m_NodeType union tests were failing. Changed it to a size_t.
-added some extra asserts to CoalesceHeap
-fixed uninitialised variable in NodePool. Only affected the unit tests
-re-implemented the virtual memory alignment. How works on all platforms in the same way. Uses the alloc hashmap to store the base addresses for pointes that have been aligned.

-Ported to Unix, OSX, iOS
-New feature - Delayed Release (currently disabled by default pending further testing)
-Include pre-built lib files for all major platforms
-Optimisation to LargeHeap - now uses HashMap
-Renamed SpinLock to CriticalSection
-Force initialisation during global initialisation and removed initialise spin lock
-Fixed some uninitialised Debug variables
-Changed g_FreeNodeMapSize so that region fits within a page
-Fixed bug with coalesceHeap page decommitting (only showed up for Coalesce Heaps of certain size. Bug not present in default VMem setup)

-MemPro stats - added functions to send stats to MemPro
-Fixed a couple of places that would crash on an out of memory. VMem will now always return NULL on an OOM.
-Defined some debug code out entirely in the integrity checking code, just in case compiler doesn't do it.
-Added some extra asserts to FSA::Free to catch bad pointers
-Changed memcpy calls to the safe memcpy_s functions
-Improved the VMem function tests. Threaded tests could sometimes generate a false positive leak error.
-Added MEMPRO define to enable MemPro allocation tracking in VMemNew.hpp

-Made SpinLock class use system critical section so that it copes with priority inversions
-destroy critical section in SpinLock destructor
-construct g_VMemCoreSpinLock and g_RecordSpinLock in VMem initialisation so that they are constructed before other globals. This could theoretically possibly have caused a race condition on allocations that happen during global initialisation, although I've never seen it occur

-Double free detection
-Settable function pointer for DebugBreak
-Optional overriding of malloc with the OVERRIDE_MALLOC define
-Comment in VMemDefs.hpp
-Moved VMEM_COALESCE_GUARDS into minimal checking because it is relatively cheap
-Functional test for double free

-VMem Release

-Fixed compile error if VMEM_STATS is defined but not VMEM_ASSERTS
-Made GetSize lock free. Speeds up Realloc by removing a global sync point. In my tests Realloc is x2 faster. This is on the USE_LOCKFREE_REGION_ARRAY define.
-Assert check for reallocing an invalid pointer
-Unit test for realloc

2004 - 2011Previous incarnations of VMem known as XMem and MemSys