Optimized C functions: Malloc and Free