Esempio n. 1
0
    void StatsTable::Private::ComputeMappedPointers(void* memory)
    {
        char* data = static_cast<char*>(memory);
        int offset = 0;

        table_header_ = reinterpret_cast<TableHeader*>(data);
        offset += sizeof(*table_header_);
        offset += AlignOffset(offset);

        // Verify we're looking at a valid StatsTable.
        DCHECK_EQ(table_header_->version, kTableVersion);

        thread_names_table_ = reinterpret_cast<char*>(data + offset);
        offset += sizeof(char) *
            max_threads() * StatsTable::kMaxThreadNameLength;
        offset += AlignOffset(offset);

        thread_tid_table_ = reinterpret_cast<PlatformThreadId*>(data + offset);
        offset += sizeof(int) * max_threads();
        offset += AlignOffset(offset);

        thread_pid_table_ = reinterpret_cast<int*>(data + offset);
        offset += sizeof(int) * max_threads();
        offset += AlignOffset(offset);

        counter_names_table_ = reinterpret_cast<char*>(data + offset);
        offset += sizeof(char) *
            max_counters() * StatsTable::kMaxCounterNameLength;
        offset += AlignOffset(offset);

        data_table_ = reinterpret_cast<int*>(data + offset);
        offset += sizeof(int) * max_threads() * max_counters();

        DCHECK_EQ(offset, size());
    }
Esempio n. 2
0
void CppiaVar::linkVarTypes(CppiaModule &cppia, int &ioOffset)
{
   DBGLOG("linkVarTypes %p\n",dynamicFunction);
   if (dynamicFunction)
   {
      //dynamicFunction->linkTypes(cppia);
      nameId = dynamicFunction->nameId;
   }
   type = cppia.types[typeId];
   if (!isVirtual)
   {
      exprType = typeId==0 ? etObject : type->expressionType;
      AlignOffset(exprType, ioOffset);
      offset = ioOffset;
      
      switch(exprType)
      {
         case etInt: ioOffset += sizeof(int); storeType=fsInt; break;
         case etFloat: ioOffset += sizeof(Float);storeType=fsFloat;  break;
         case etString: ioOffset += sizeof(String);storeType=fsString;  break;
         case etObject: ioOffset += sizeof(hx::Object *);storeType=fsObject;  break;
         case etVoid:
         case etNull:
            break;
      }
   }
}