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); }
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); }
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; }
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); }
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); } }
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; }
void setHeaderField(const char *key, const char *value) { header.insert(key, value); }
void loom_asset_registerType(unsigned int type, LoomAssetDeserializeCallback deserializer, LoomAssetRecognizerCallback recognizer) { gAssetDeserializerMap.insert(type, deserializer); gRecognizerList.push_back(recognizer); }