watch for stacj overflow in heap_copy()