Fix performance of multiple same size allocations. am: 0af4ee86df
am: 592a1ea7a9

Change-Id: I5a685ce066df98d461b258945b2c1ebfd6091d79