tidy: minor doc improvements + String::share() with explicit mm

This commit is contained in:
Roland Conybeare 2025-11-15 14:04:56 -05:00
commit 9761688cfe
4 changed files with 13 additions and 1 deletions

View file

@ -17,6 +17,8 @@ namespace xo {
/** create shared string @p s, using allocator @ref Object::mm **/
static gp<String> share(const char * s);
/** create shared string @p s, using allocator @p mm **/
static gp<String> share(gc::IAlloc * mm, const char * s);
/** create copy of string @p s, using allocator @ref Object::mm **/
static gp<String> copy(const char * s);
/** create copy of string @p s, using allocator @p mm **/

View file

@ -44,6 +44,12 @@ namespace xo {
gp<String>
String::share(const char * s) {
return share(Object::mm, s);
}
gp<String>
String::share(gc::IAlloc * mm, const char * s)
{
const char * chars = s ? s : "";
std::size_t z = 1 + ::strlen(chars);