Added malloc & free implementation to core.c (change soon plx)