Updated documentation in mem.cpp