Made function in class Memory global. Used CStaticAllocator to encapsulate static memory allocation.