[foreign-abi] [Rev 01] RFR: 8247488: Add support for string helpers in CSupport (decoding support)

Maurizio Cimadamore mcimadamore at openjdk.java.net
Tue Jun 16 12:05:53 UTC 2020


> This patch add more symmetric support for charset-driven decoding of the contents of a native string.
> That means we can no longer using a StringBuilder, but, instead, we have to get the byte array and create a `String`
> out of that using specified `Charset` instance.
> Implementation-wise, following an offline discussion with Jorn, I've settled for an approach which finds string length,
> then does a bulk copy to a byte array. Not sure this is going to peform well on small strings. The alternative would
> have been to use `ByteArrayOutputStream` - but the issue there is that both `write` and `toString` methods there are
> `synchronized`.  In any case, I think the implementation can be made more efficient later, if we find that to be an
> issue.

Maurizio Cimadamore has updated the pull request incrementally with one additional commit since the last revision:

  Fix javadoc issues with restricted methods

-------------

Changes:
  - all: https://git.openjdk.java.net/panama-foreign/pull/207/files
  - new: https://git.openjdk.java.net/panama-foreign/pull/207/files/f538ccb6..4b414dc2

Webrevs:
 - full: https://webrevs.openjdk.java.net/panama-foreign/207/webrev.01
 - incr: https://webrevs.openjdk.java.net/panama-foreign/207/webrev.00-01

  Stats: 4 lines in 2 files changed: 0 ins; 0 del; 4 mod
  Patch: https://git.openjdk.java.net/panama-foreign/pull/207.diff
  Fetch: git fetch https://git.openjdk.java.net/panama-foreign pull/207/head:pull/207

PR: https://git.openjdk.java.net/panama-foreign/pull/207


More information about the panama-dev mailing list