Teach external.c to handle reallocs before compression