Closed qinsoon closed 4 months ago
Other than the inefficiency, one big issue for this PR is that the address we return may not be the base reference for the given address. It could be the previous object that ends before the address. We will have to check against the object size to know if the given address is within the object range. However, we cannot get the object size as we don't know the object reference.
I think we would want to enforce object reference alignment so we can know the object reference using VO bit. I feel that is essential.
Superseded by #1165
This PR adds a function to our API
find_object_from_internal_pointer
. It uses a simple implementation withis_vo_bit_set_for_addr
which is not efficient.An efficient implementation should be able to bulk load side metadata, check the last bit set and deduce the data address from the bit. However, there are many corner cases for this that I haven't sorted out, and it would need more testing before we can make it ready. I think it might be a good idea to have the API first with a naive implementation which works. We can optimize it later.