示例#1
0
void loom_asset_registerType(unsigned int type, LoomAssetDeserializeCallback deserializer, LoomAssetRecognizerCallback recognizer)
{
    lmAssert(gAssetDeserializerMap.find(type) == UT_NPOS, "Asset type already registered!");

    gAssetDeserializerMap.insert(type, deserializer);
    gRecognizerList.push_back(recognizer);
}
示例#2
0
static inline void primeProfiler()
{
    const char       *path = ".......";
    LoomProfilerRoot **prd = dynamicProfilerRoots[path];

    if (prd == NULL)
    {
        dynamicProfilerRoots.insert(path, new LoomProfilerRoot(strdup(path)));
        prd = dynamicProfilerRoots[path];
    }

    gLoomProfiler->hashPush(*prd);
    gLoomProfiler->hashPop(*prd);
}
示例#3
0
static loom_asset_t *loom_asset_getAssetByName(const char *name, int create)
{
    utHashedString key        = platform_normalizePath(name);
    loom_asset_t   **assetPtr = gAssetHash.get(key);
    loom_asset_t   *asset     = assetPtr ? *assetPtr : NULL;

    if ((asset == NULL) && create)
    {
        // Create one.
        asset       = lmNew(gAssetAllocator) loom_asset_t;
        asset->name = strdup(name);
        gAssetHash.insert(key, asset);
    }

    return asset;
}
示例#4
0
void LSProfiler::enterMethod(const char *fullPath)
{
    if (!isEnabled())
    {
        return;
    }

    //printf("Entering %s\n", fullPath);

    LoomProfilerRoot **prd = dynamicProfilerRoots[fullPath];
    if (prd == NULL)
    {
        dynamicProfilerRoots.insert(fullPath, new LoomProfilerRoot(strdup(fullPath)));
        prd = dynamicProfilerRoots[fullPath];
    }

    gLoomProfiler->hashPush(*prd);
}
示例#5
0
    static void regenerateSourceBreakpoints()
    {
        sourceBreakpoints.clear();

        for (UTsize i = 0; i < breakpoints.size(); i++)
        {
            Breakpoint *bp = breakpoints.at(i);

            utFastStringHash fhash(bp->source);

            if (sourceBreakpoints.find(fhash) == UT_NPOS)
            {
                utArray<Breakpoint *> bps;
                sourceBreakpoints.insert(fhash, bps);
            }

            sourceBreakpoints.get(fhash)->push_back(bp);
        }
    }
示例#6
0
static loom_asset_t *loom_asset_getAssetByName(const char *name, int create)
{
    loom_mutex_lock(gAssetLock);
    static char normalized[4096];
    strncpy(normalized, name, sizeof(normalized));
    platform_normalizePath(normalized);
    utHashedString key        = normalized;
    loom_mutex_unlock(gAssetLock);
    loom_asset_t   **assetPtr = gAssetHash.get(key);
    loom_asset_t   *asset     = assetPtr ? *assetPtr : NULL;

    if ((asset == NULL) && create)
    {
        // Create one.
        asset       = lmNew(gAssetAllocator) loom_asset_t;
        asset->name = name;
        gAssetHash.insert(key, asset);
    }

    return asset;
}
示例#7
0
 void setHeaderField(const char *key, const char *value)
 {
     header.insert(key, value);
 }
示例#8
0
void loom_asset_registerType(unsigned int type, LoomAssetDeserializeCallback deserializer, LoomAssetRecognizerCallback recognizer)
{
    gAssetDeserializerMap.insert(type, deserializer);
    gRecognizerList.push_back(recognizer);
}