예제 #1
0
  public boolean copyFromChannel(FileChannel channel, TableStats stats) throws IOException {
    if (channel.position() < channel.size()) {
      clear();

      buffer.clear();
      channel.read(buffer);
      memorySize = buffer.position();

      while (position < memorySize) {
        long recordPtr = address + position;

        if (remain() < SizeOf.SIZE_OF_INT) {
          channel.position(channel.position() - remain());
          memorySize = (int) (memorySize - remain());
          return true;
        }

        int recordSize = UNSAFE.getInt(recordPtr);

        if (remain() < recordSize) {
          channel.position(channel.position() - remain());
          memorySize = (int) (memorySize - remain());
          return true;
        }

        position += recordSize;
        rowNum++;
      }

      return true;
    } else {
      return false;
    }
  }
예제 #2
0
 public static int getFunctionIndex(LLVMAddress addr) {
   int functionIndex = UNSAFE.getInt(LLVMMemory.extractAddr(addr));
   return functionIndex;
 }