// This code is in the public domain -- Ignacio CastaƱo #ifndef NV_CORE_MEMORY_H #define NV_CORE_MEMORY_H #include "nvcore.h" #include namespace nv { // C++ helpers. template inline T * malloc(size_t count) { return (T *)::malloc(sizeof(T) * count); } template inline T * realloc(T * ptr, size_t count) { return (T *)::realloc(ptr, sizeof(T) * count); } template inline void free(const T * ptr) { ::free((void *)ptr); } template inline void zero(T & data) { memset(&data, 0, sizeof(T)); } } // nv namespace #endif // NV_CORE_MEMORY_H