Bug 168564
| Summary: | JSC C-API Needs a non-copying stringref constructor | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Oliver Hunt <oliver> |
| Component: | JavaScriptCore | Assignee: | Nobody <webkit-unassigned> |
| Status: | NEW | ||
| Severity: | Normal | CC: | fpizlo, ggaren, jfbastien, saam |
| Priority: | P2 | ||
| Version: | WebKit Local Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
Oliver Hunt
I've been trying to improve load and parse time in some local (e.g. insane) code, and i realized that a common problem i'm having is that i have to cause a copy of data because we don't have a NoCopy() API that takes bytes + encoding + finalizer callback.
Something like
JSStringCreateWithByteNoCopy(void* bytes, size_t length, CFStringEncoding encoding, void(finalizer)(bytes));
Would be great
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Oliver Hunt
Or rather:
JSStringCreateWithByteNoCopy(void* context, const uint8_t* bytes, size_t length, void(finalizer)(void* context, const uint8_t* bytes));
Which is more in line with what CF does.