[foreign] RFR 8210967: Consolidate Scope API

Sundararajan Athijegannathan sundararajan.athijegannathan at oracle.com
Thu Sep 20 16:23:09 UTC 2018

Looks good

PS. allocateString -> allocateCString? It is null terminated C char* ...


On 20/09/18, 9:27 PM, Maurizio Cimadamore wrote:
> Hi,
> 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).
> Webrev:
> http://cr.openjdk.java.net/~mcimadamore/panama/8210967/
> Maurizio

More information about the panama-dev mailing list