Reducing allocations in performance sensitive code