Ejemplo n.º 1
0
void MiniPS::delete0(VALUE v) {
  if (isDirect(v)) return;
  Value *vp=RVALUE(v);
  unsigned ty=vp->getType();
  if (ty==T_DICT) RDICT(v)->free();
  else if (ty==T_ARRAY) RARRAY(v)->free();
  else if (ty==T_VOID) ;
  else if (vp->hasPtr()) delete [] vp->begin_();
  delete vp; /* BUGFIX at Sat Sep  7 12:50:13 CEST 2002 */
}
Ejemplo n.º 2
0
size_t JByteBuffer::getDirectSize() const {
  if (!self()) {
    throwNewJavaException("java/lang/NullPointerException", "java.lang.NullPointerException");
  }
  int size = Environment::current()->GetDirectBufferCapacity(self());
  FACEBOOK_JNI_THROW_PENDING_EXCEPTION();
  if (size < 0) {
    throw std::runtime_error(
        isDirect() ?
          "Attempt to get direct size of non-direct byte buffer." :
          "Error getting direct size of byte buffer.");
  }
  return static_cast<size_t>(size);
}
Ejemplo n.º 3
0
uint8_t* JByteBuffer::getDirectBytes() const {
  if (!self()) {
    throwNewJavaException("java/lang/NullPointerException", "java.lang.NullPointerException");
  }
  void* bytes = Environment::current()->GetDirectBufferAddress(self());
  FACEBOOK_JNI_THROW_PENDING_EXCEPTION();
  if (!bytes) {
    throw std::runtime_error(
        isDirect() ?
          "Attempt to get direct bytes of non-direct byte buffer." :
          "Error getting direct bytes of byte buffer.");
  }
  return static_cast<uint8_t*>(bytes);
}
Ejemplo n.º 4
0
//_________________________________________________________________________________________________
bool BranchInst::canReverse() const 
{
    return node!=NULL && isDirect() && ControlTransferInst::canReverse();
}