Mimic free()/delete behavior