Skip to content

Document/export copy-free string allocation? #19945

Open
@stevengj

Description

@stevengj

There are now (as of #19449) undocumented functions Base._string_n(n) (to allocate an n-byte string) and Base.StringVector(n) (to allocate an n-byte array that can be converted to a string without copying). Should some version of these be documented and exported? They seem useful for e.g. string processing and calling C APIs expecting pre-allocated string buffers.

Note also that the String(v::Vector{UInt8}) documentation, which says that it takes "ownership" of the array, seems to be wrong now (unless v was allocated with StringVector).

cc @JeffBezanson, @nalimilan

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsThis change adds or pertains to documentationstrings"Strings!"

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions