Beispiel #1
0
void ProxyArray::proxyAppend(void* data, uint32_t data_size, void** dest) {
  ArrayData * r;
  if (hasZvalValues()) {
    assert(data_size == sizeof(void*));
    int64_t k = 0;
    r = m_ad->zAppend(*(RefData**)data, &k);
    if (dest) {
      *dest = (void*)(&m_ad->nvGet(k)->m_data.pref);
    }
  } else {
    ResourceData * elt = makeElementResource(data, data_size, dest);
    r = m_ad->append(elt, false);
  }
  reseatable(this, r);
}
Beispiel #2
0
void ProxyArray::proxyAppend(void* data, uint32_t data_size, void** dest) {
  ArrayData * r;
  if (hasZvalValues()) {
    assert(data_size == sizeof(void*));
    int64_t k = 0;
    r = innerArr(this)->zAppend(*(RefData**)data, &k);
    if (dest) {
      *dest = (void*)(&r->nvGet(k)->m_data.pref);
    }
  } else {
    auto elt = makeElementResource(data, data_size, dest);
    r = innerArr(this)->append(Variant(std::move(elt)), false);
  }
  reseatable(this, r);
}