summaryrefslogtreecommitdiffstats
path: root/drivers/unix/file_access_unix.cpp
diff options
context:
space:
mode:
authorJan Haller <bromeon@gmail.com>2023-07-30 15:40:38 +0200
committerJan Haller <bromeon@gmail.com>2023-09-24 18:18:05 +0200
commited3015e97962cfe483e9206601bb9c6ab7648c9a (patch)
tree57506f53fd4828172895788827ad8f94e9801011 /drivers/unix/file_access_unix.cpp
parent59139df16e7a10c3b9176f697d23b557af46601e (diff)
downloadredot-engine-ed3015e97962cfe483e9206601bb9c6ab7648c9a.tar.gz
GDExtension: construct StringName directly from char*
So far, an indirection via String was necessary, causing at least 2 allocations and copies (String; String inside StringName). Since StringNames often refer to string literals, this allows them to be directly constructed from C strings. There are two formats: Latin-1 and UTF-8. The Latin-1 constructor also provides the `p_is_static` flag: when the source has static storage duration, no copy/allocation will be needed. However, the extension developer needs to uphold this lifetime guarantee.
Diffstat (limited to 'drivers/unix/file_access_unix.cpp')
0 files changed, 0 insertions, 0 deletions