At present a get-scopes call returns a concrete array of dies, corresponding to the long[] array returned by the underlying dwfl. Instead encapsulate the long[] array in a DwarfScopeDies object and then only create individual dies as needed - this should better match the underlying interface where the dies array are just passed back to later functions - treated like a handle. It may even be possible to avoid the allocation of the long[] array, and just encapsulate the malloc-ed pointer