xo-alloc + xo-allocutil: refactor to shrink dep surface area
This commit is contained in:
parent
8d4649c6cf
commit
540b43d971
34 changed files with 479 additions and 323 deletions
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include "xo/alloc/IAlloc.hpp"
|
||||
#include "xo/allocutil/IAlloc.hpp"
|
||||
#include <cstdint>
|
||||
|
||||
namespace xo {
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ namespace xo {
|
|||
/** create instance holding integer value @p x **/
|
||||
static gp<Integer> make(IAlloc * mm, int_type x);
|
||||
/** downcast from @p x iff x is actually an Integer. Otherwise nullptr **/
|
||||
static gp<Integer> from(gp<Object> x);
|
||||
static gp<Integer> from(gp<IObject> x);
|
||||
|
||||
int_type value() const { return value_; }
|
||||
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ namespace xo {
|
|||
static gp<List> nil;
|
||||
|
||||
/** @return non-null iff @p x is actually a List cell (or nil) **/
|
||||
static gp<List> from(gp<Object> x);
|
||||
static gp<List> from(gp<IObject> x);
|
||||
|
||||
/** @return list with first element @p car, and tail @p cdr **/
|
||||
static gp<List> cons(gp<Object> car, gp<List> cdr);
|
||||
|
|
@ -44,7 +44,7 @@ namespace xo {
|
|||
/** @return first element in list; synonym for @ref head **/
|
||||
gp<Object> car() const { return head_; }
|
||||
/** @return remainder of list after first element; synonym for @ref rest **/
|
||||
gp<Object> cdr() const { return rest_; }
|
||||
gp<List> cdr() const { return rest_; }
|
||||
|
||||
/** @return number of top-level elements in this list **/
|
||||
std::size_t size() const;
|
||||
|
|
@ -58,7 +58,7 @@ namespace xo {
|
|||
virtual TaggedPtr self_tp() const final override;
|
||||
virtual void display(std::ostream & os) const final override;
|
||||
virtual std::size_t _shallow_size() const final override;
|
||||
virtual Object * _shallow_copy(gc::IAlloc * gc) const final override;
|
||||
virtual IObject * _shallow_copy(gc::IAlloc * gc) const final override;
|
||||
virtual std::size_t _forward_children(gc::IAlloc * gc) final override;
|
||||
|
||||
private:
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
#include "xo/alloc/Object.hpp"
|
||||
#include "ObjectConversion.hpp"
|
||||
#include "xo/alloc/IAlloc.hpp"
|
||||
#include "xo/allocutil/IAlloc.hpp"
|
||||
#include "xo/indentlog/print/tag.hpp"
|
||||
|
||||
namespace xo {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue