[foreign] RFR 8210967: Consolidate Scope API
maurizio.cimadamore at oracle.com
Thu Sep 20 15:57:40 UTC 2018
this is a simple webrev with some cosmetic changes to Scope.
First, it renames Scope::toCStr to Scope::allocateString (to bring it in
sync with remaining allocateXYZ methods)
Second, it removes the Scope::toCStrArray and moves it where it is used
(clang/FFI test). The rationale for the removal is that I don't think
that, as a primitive, this is 'hot enough' to deserve a place in the
API. Note also that 'string array' is a tad ambiguous in that some users
might infer that the method is allocating a chunk of memory big enough
to hold all the strings of the source array. For these reasons, I've
decided to drop it for now - if use cases suggest otherwise, we can add
it back in some form.
Third, it add the javadoc to allocateString, which was missing.
Fourth, the implementation of allocateString is now much simpler, and
just piggy backs on allocateArray (as it should).
More information about the panama-dev