update heap resizing code to latest proposal