rename Bytecode to BytecodeRef
parent
a0130089cf
commit
f1b85d9133
|
@ -2511,19 +2511,19 @@ void bcode_unref(ostd::Uint32 *code) {
|
|||
}
|
||||
}
|
||||
|
||||
Bytecode::Bytecode(ostd::Uint32 *v): p_code(v) { bcode_ref(p_code); }
|
||||
Bytecode::Bytecode(Bytecode const &v): p_code(v.p_code) { bcode_ref(p_code); }
|
||||
BytecodeRef::BytecodeRef(ostd::Uint32 *v): p_code(v) { bcode_ref(p_code); }
|
||||
BytecodeRef::BytecodeRef(BytecodeRef const &v): p_code(v.p_code) { bcode_ref(p_code); }
|
||||
|
||||
Bytecode::~Bytecode() { bcode_unref(p_code); }
|
||||
BytecodeRef::~BytecodeRef() { bcode_unref(p_code); }
|
||||
|
||||
Bytecode &Bytecode::operator=(Bytecode const &v) {
|
||||
BytecodeRef &BytecodeRef::operator=(BytecodeRef const &v) {
|
||||
bcode_unref(p_code);
|
||||
p_code = v.p_code;
|
||||
bcode_ref(p_code);
|
||||
return *this;
|
||||
}
|
||||
|
||||
Bytecode &Bytecode::operator=(Bytecode &&v) {
|
||||
BytecodeRef &BytecodeRef::operator=(BytecodeRef &&v) {
|
||||
bcode_unref(p_code);
|
||||
p_code = v.p_code;
|
||||
v.p_code = nullptr;
|
||||
|
|
|
@ -38,16 +38,16 @@ enum {
|
|||
IDF_ARG = 1 << 6
|
||||
};
|
||||
|
||||
struct OSTD_EXPORT Bytecode {
|
||||
Bytecode(): p_code(nullptr) {}
|
||||
Bytecode(ostd::Uint32 *v);
|
||||
Bytecode(Bytecode const &v);
|
||||
Bytecode(Bytecode &&v): p_code(v.p_code) { v.p_code = nullptr; }
|
||||
struct OSTD_EXPORT BytecodeRef {
|
||||
BytecodeRef(): p_code(nullptr) {}
|
||||
BytecodeRef(ostd::Uint32 *v);
|
||||
BytecodeRef(BytecodeRef const &v);
|
||||
BytecodeRef(BytecodeRef &&v): p_code(v.p_code) { v.p_code = nullptr; }
|
||||
|
||||
~Bytecode();
|
||||
~BytecodeRef();
|
||||
|
||||
Bytecode &operator=(Bytecode const &v);
|
||||
Bytecode &operator=(Bytecode &&v);
|
||||
BytecodeRef &operator=(BytecodeRef const &v);
|
||||
BytecodeRef &operator=(BytecodeRef &&v);
|
||||
|
||||
operator bool() const { return p_code != nullptr; }
|
||||
operator ostd::Uint32 *() const { return p_code; }
|
||||
|
|
Loading…
Reference in New Issue