rewrote in-kernel memory management
replaced memory manager with malloc and free, seems to be faster