You might be interested in resizing arrays without re-allocating them
which is found in
Does SWI-Prolog have N+K-trees?
I know the documeation is not easy to find or follow in the topic and there is no official documentation on it but for certain cases it is rather useful.