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

@ -9,9 +9,13 @@
namespace xo {
namespace fn {
/** callback set using unique pointers to store callbacks **/
template <typename NativeFn>
using UpCallbackSet = CallbackSetImpl<std::unique_ptr<NativeFn>>;
/** callback set that invokes a specific member function on
* registered callback objects.
**/
template <typename NativeFn, typename MemberFn>
requires(callback_concept<NativeFn>)
class UpNotifyCallbackSet : public UpCallbackSet<NativeFn> {

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);

View file

@ -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.