Currently asm-interp changes it's return type if the runtime uses a heap and produces a pair of the result and a pointer to the heap. The latter is only used to free the memory after the value has been reconstructed. You don't need the heap pointer to reconstruct the value.
It seems to make more sense to just not free the memory and return the bits in rax, from which the value can be reconstructed. This keeps the concept of asm-interp simple and consistent from Abscond through to the end.
There's some worry about leaking memory, but one solution is to have asm-interp re-use the heap memory on each call (it may already do this, I'm not sure). This means you have to be done using the memory before another call to asm-interp happens, but that seems reasonable.
Currently
asm-interp
changes it's return type if the runtime uses a heap and produces a pair of the result and a pointer to the heap. The latter is only used to free the memory after the value has been reconstructed. You don't need the heap pointer to reconstruct the value.It seems to make more sense to just not free the memory and return the bits in rax, from which the value can be reconstructed. This keeps the concept of
asm-interp
simple and consistent from Abscond through to the end.There's some worry about leaking memory, but one solution is to have
asm-interp
re-use the heap memory on each call (it may already do this, I'm not sure). This means you have to be done using the memory before another call toasm-interp
happens, but that seems reasonable.