Skip to content

Instantly share code, notes, and snippets.

@rightfold
Last active August 29, 2015 14:17
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save rightfold/56327a6989304b80f0d5 to your computer and use it in GitHub Desktop.
class Value {
public:
virtual ~Value() = 0;
private:
std::size_t retain_count;
};
Value::~Value() = default;
// vtable for synthesized type
std::ptrdiff_t offsetToTop; // = 0;
std::type_info const* typeInfo; // = &typeInfo;
void(* dtorFirst)(void*); // = dtor
void(* dtorSecond)(void*); // = dtor
// note: dtor must call this->Value::~Value()
// type info for synthesized type
abi::__si_class_type_info typeInfo("std::Boolean", (abi::__si_class_type_info*)&typeid(Value));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment