Merge branch 'master' of https://github.com/Microsoft/pxt-microbit
This commit is contained in:
commit
7f27432222
@ -117,7 +117,6 @@ namespace pxt {
|
|||||||
|
|
||||||
void RefObject::destroy() {
|
void RefObject::destroy() {
|
||||||
((RefObjectMethod)getVTable()->methods[0])(this);
|
((RefObjectMethod)getVTable()->methods[0])(this);
|
||||||
delete this;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void RefObject::print() {
|
void RefObject::print() {
|
||||||
@ -132,6 +131,9 @@ namespace pxt {
|
|||||||
if (refmask[i]) decr(r->fields[i]);
|
if (refmask[i]) decr(r->fields[i]);
|
||||||
r->fields[i] = 0;
|
r->fields[i] = 0;
|
||||||
}
|
}
|
||||||
|
//RefRecord is allocated using placement new
|
||||||
|
r->~RefRecord();
|
||||||
|
::operator delete(r);
|
||||||
}
|
}
|
||||||
|
|
||||||
void RefRecord_print(RefRecord *r)
|
void RefRecord_print(RefRecord *r)
|
||||||
@ -242,6 +244,7 @@ namespace pxt {
|
|||||||
this->data[i] = 0;
|
this->data[i] = 0;
|
||||||
}
|
}
|
||||||
this->data.resize(0);
|
this->data.resize(0);
|
||||||
|
delete this;
|
||||||
}
|
}
|
||||||
|
|
||||||
void RefCollection::print()
|
void RefCollection::print()
|
||||||
@ -258,6 +261,9 @@ namespace pxt {
|
|||||||
decr(fields[i]);
|
decr(fields[i]);
|
||||||
fields[i] = 0;
|
fields[i] = 0;
|
||||||
}
|
}
|
||||||
|
//RefAction is allocated using placement new
|
||||||
|
this->~RefAction();
|
||||||
|
::operator delete(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
void RefAction::print()
|
void RefAction::print()
|
||||||
@ -272,6 +278,7 @@ namespace pxt {
|
|||||||
|
|
||||||
void RefLocal::destroy()
|
void RefLocal::destroy()
|
||||||
{
|
{
|
||||||
|
delete this;
|
||||||
}
|
}
|
||||||
|
|
||||||
PXT_VTABLE_CTOR(RefLocal) {
|
PXT_VTABLE_CTOR(RefLocal) {
|
||||||
@ -290,6 +297,7 @@ namespace pxt {
|
|||||||
void RefRefLocal::destroy()
|
void RefRefLocal::destroy()
|
||||||
{
|
{
|
||||||
decr(v);
|
decr(v);
|
||||||
|
delete this;
|
||||||
}
|
}
|
||||||
|
|
||||||
PXT_VTABLE_BEGIN(RefMap, 0, RefMapMarker)
|
PXT_VTABLE_BEGIN(RefMap, 0, RefMapMarker)
|
||||||
@ -304,6 +312,7 @@ namespace pxt {
|
|||||||
data[i].val = 0;
|
data[i].val = 0;
|
||||||
}
|
}
|
||||||
data.resize(0);
|
data.resize(0);
|
||||||
|
delete this;
|
||||||
}
|
}
|
||||||
|
|
||||||
int RefMap::findIdx(uint32_t key) {
|
int RefMap::findIdx(uint32_t key) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user