void tv_release_typed(RefData* pv, DataType dt) {
  assert(Transl::tx64->stateIsDirty());
  assert(dt == KindOfString || dt == KindOfArray ||
         dt == KindOfObject || dt == KindOfResource ||
         dt == KindOfRef);
  g_destructors[typeToDestrIndex(dt)](pv);
}
// TODO(#2031980): clear these out
void tv_release_generic(TypedValue* tv) {
  assert(Transl::tx64->stateIsDirty());
  assert(tv->m_type == KindOfString || tv->m_type == KindOfArray ||
         tv->m_type == KindOfObject || tv->m_type == KindOfResource ||
         tv->m_type == KindOfRef);
  g_destructors[typeToDestrIndex(tv->m_type)](tv->m_data.pref);
}
Beispiel #3
0
void tvDecRefHelper(DataType type, uint64_t datum) {
  assert(type == KindOfString || type == KindOfArray ||
         type == KindOfObject || type == KindOfResource ||
         type == KindOfRef);
  DECREF_AND_RELEASE_MAYBE_STATIC(
    ((RefData*)datum),
    g_destructors[typeToDestrIndex(type)]((void*)datum));
}
void tvDecRefHelper(DataType type, uint64_t datum) noexcept {
  assert(type == KindOfString || type == KindOfArray ||
         type == KindOfObject || type == KindOfResource ||
         type == KindOfRef);
  if (((ArrayData*)datum)->decReleaseCheck()) {
    g_destructors[typeToDestrIndex(type)]((void*)datum);
  }
}