xo-alloc xo-object: + Object.self_tp
This commit is contained in:
parent
ea60d107e8
commit
150bfa4aa2
11 changed files with 76 additions and 14 deletions
|
|
@ -5,12 +5,17 @@
|
|||
|
||||
#include "String.hpp"
|
||||
#include "GC.hpp"
|
||||
#include "TaggedPtr.hpp"
|
||||
#include "xo/reflect/Reflect.hpp"
|
||||
#include <bsd/string.h>
|
||||
#include <cstddef>
|
||||
#include <cstring>
|
||||
#include <cassert>
|
||||
|
||||
namespace xo {
|
||||
using xo::reflect::Reflect;
|
||||
using xo::reflect::TaggedPtr;
|
||||
|
||||
namespace obj {
|
||||
String::String(owner owner, std::size_t z, char * s)
|
||||
: owner_{owner}, z_chars_{z}, chars_{s}
|
||||
|
|
@ -86,6 +91,11 @@ namespace xo {
|
|||
return ::strlen(chars_);
|
||||
}
|
||||
|
||||
TaggedPtr
|
||||
String::self_tp() const {
|
||||
return Reflect::make_tp(const_cast<String*>(this));
|
||||
}
|
||||
|
||||
// ----- GC support -----
|
||||
|
||||
std::size_t
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue