From 9761688cfee5bc41b29b4074e8b145bcff1b4ab0 Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Sat, 15 Nov 2025 14:04:56 -0500 Subject: [PATCH] tidy: minor doc improvements + String::share() with explicit mm --- xo-callback/include/xo/callback/UpCallbackSet.hpp | 4 ++++ xo-object/include/xo/object/String.hpp | 2 ++ xo-object/src/object/String.cpp | 6 ++++++ xo-reader/README | 2 +- 4 files changed, 13 insertions(+), 1 deletion(-) diff --git a/xo-callback/include/xo/callback/UpCallbackSet.hpp b/xo-callback/include/xo/callback/UpCallbackSet.hpp index a8a39128..86d04a18 100644 --- a/xo-callback/include/xo/callback/UpCallbackSet.hpp +++ b/xo-callback/include/xo/callback/UpCallbackSet.hpp @@ -9,9 +9,13 @@ namespace xo { namespace fn { + /** callback set using unique pointers to store callbacks **/ template using UpCallbackSet = CallbackSetImpl>; + /** callback set that invokes a specific member function on + * registered callback objects. + **/ template requires(callback_concept) class UpNotifyCallbackSet : public UpCallbackSet { diff --git a/xo-object/include/xo/object/String.hpp b/xo-object/include/xo/object/String.hpp index 9d74ff22..b63744aa 100644 --- a/xo-object/include/xo/object/String.hpp +++ b/xo-object/include/xo/object/String.hpp @@ -17,6 +17,8 @@ namespace xo { /** create shared string @p s, using allocator @ref Object::mm **/ static gp share(const char * s); + /** create shared string @p s, using allocator @p mm **/ + static gp share(gc::IAlloc * mm, const char * s); /** create copy of string @p s, using allocator @ref Object::mm **/ static gp copy(const char * s); /** create copy of string @p s, using allocator @p mm **/ diff --git a/xo-object/src/object/String.cpp b/xo-object/src/object/String.cpp index d5e00928..b4d3c02c 100644 --- a/xo-object/src/object/String.cpp +++ b/xo-object/src/object/String.cpp @@ -44,6 +44,12 @@ namespace xo { gp String::share(const char * s) { + return share(Object::mm, s); + } + + gp + String::share(gc::IAlloc * mm, const char * s) + { const char * chars = s ? s : ""; std::size_t z = 1 + ::strlen(chars); diff --git a/xo-reader/README b/xo-reader/README index cee8b46c..2c4a55b7 100644 --- a/xo-reader/README +++ b/xo-reader/README @@ -7,7 +7,7 @@ def foo = lambda (n : i64) { let (n == 0) then 1 else n * foo(n - 1); }; strategy: ----------- +-------- while parsing def, instead of creating DefineExpr with nullptr TypeDescr: a. create DefineExpr with TypeVariable.