tidy: minor doc improvements + String::share() with explicit mm
This commit is contained in:
parent
07b6cc949f
commit
9761688cfe
4 changed files with 13 additions and 1 deletions
|
|
@ -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> {
|
||||
|
|
|
|||
|
|
@ -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 **/
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue