Moved unnecessary heap allocations to data segment allocations