get rid of allow_heap flag
prefer calloc over malloc: mult-overflow detection, zeroing