Exemplo n.º 1
0
void MipsJit::Compile(u32 em_address) {
	PROFILE_THIS_SCOPE("jitc");
	if (GetSpaceLeft() < 0x10000 || blocks.IsFull()) {
		ClearCache();
	}
	int block_num = blocks.AllocateBlock(em_address);
	JitBlock *b = blocks.GetBlock(block_num);
	DoJit(em_address, b);
	blocks.FinalizeBlock(block_num, jo.enableBlocklink);

	bool cleanSlate = false;

	if (js.hasSetRounding && !js.lastSetRounding) {
		WARN_LOG(JIT, "Detected rounding mode usage, rebuilding jit with checks");
		// Won't loop, since hasSetRounding is only ever set to 1.
		js.lastSetRounding = js.hasSetRounding;
		cleanSlate = true;
	}

	if (cleanSlate) {
		// Our assumptions are all wrong so it's clean-slate time.
		ClearCache();
		Compile(em_address);
	}
}
Exemplo n.º 2
0
void c4_HandlerSeq::DetachFromStorage(bool full_)
{
    if (_persist != 0) {
        int limit = full_ ? 0 : NumFields();

        // get rid of all handlers which might do I/O
        for (int c = NumHandlers(); --c >= 0;) {
            c4_Handler &h = NthHandler(c);

            // all nested fields are detached recursively
            if (IsNested(c))
                for (int r = 0; r < NumRows(); ++r)
                    if (h.HasSubview(r)) {
                        SubEntry(c, r).DetachFromStorage(full_);
                    }

            if (c >= limit) {
                if (h.IsPersistent()) {
                    delete  &h;
                    _handlers.RemoveAt(c);
                    ClearCache();
                }
            }
        }

        if (full_) {
            //UnmappedAll();
            _persist = 0;
        }
    }
}
Exemplo n.º 3
0
STDMETHODIMP CEtsDivColl::Clone(IEtsDivColl** ppVal)
{
	HRESULT hr = S_OK;
	__CHECK_POINTER(ppVal);

	try
	{
		ClearCache();
		IEtsDivCollPtr spColl;
		CComObject<CEtsDivColl>* pColl = NULL;
		_CHK(CComObject<CEtsDivColl>::CreateInstance(&pColl));
		spColl.Attach(pColl, TRUE);
		if(!m_DivColl.empty())
		{
			EnumIterType itr = m_DivColl.begin();
			while(itr!=m_DivColl.end())
			{
				pColl->m_DivColl.insert(*itr);
				++itr;
			}

		}   
		*ppVal = spColl.Detach();
	}
	catch (_com_error& e) 
	{
		hr =  Error((PTCHAR)EgLib::CComErrorWrapper::ErrorDescription(e), IID_IEtsDivColl, e.Error());
	}
	return hr;
}
Exemplo n.º 4
0
bool Unitsync::LoadUnitSyncLib(const std::string& unitsyncloc)
{
	LOCK_UNITSYNC;
	ClearCache();
	const bool ret = susynclib().Load(unitsyncloc);
	if (!ret) {
		return false;
	}
	const std::string datadir = LSL::Util::config().GetDataDir();
	const std::string curdatadir = susynclib().GetSpringDataDir();
	if (datadir != curdatadir) {
		LslWarning("Reloading unitsync due to datadir change: %s -> %s", curdatadir.c_str(), datadir.c_str());
		SetSpringDataPath(datadir);
		susynclib().Load(unitsyncloc);
	}
	supportsManualUnLoad = LSL::susynclib().GetSpringConfigInt("UnitsyncAutoUnLoadMapsIsSupported", 0) != 0;
	if (supportsManualUnLoad) {
		LslDebug("Unitsync supports manual loading of archives (faster, yey!)");
		LSL::usync().SetSpringConfigInt("UnitsyncAutoUnLoadMaps", 1);
	} else {
		LslDebug("Unitsync doesn't support manual loading of archives :-/");
	}


	m_cache_path = LSL::Util::config().GetCachePath();
	PopulateArchiveList();
	return true;
}
Exemplo n.º 5
0
Unitsync::~Unitsync()
{
	ClearCache();
	delete m_cache_thread;
	m_cache_thread = NULL;
	Cache::FreeInstance();
}
Exemplo n.º 6
0
void ImgCell::Draw(CellParser& parser, wxPoint point, int fontsize)
{
  wxDC& dc = parser.GetDC();

  if (DrawThisCell(parser, point) && m_image != NULL)
  {
    wxMemoryDC bitmapDC;
    double scale = parser.GetScale();
    m_image->ViewportSize(m_canvasSize.x,m_canvasSize.y,scale);
  
    m_height = (m_image->m_height) + 2 * m_imageBorderWidth;
    m_width  = (m_image->m_width)  + 2 * m_imageBorderWidth;

    SetPen(parser);
    if (m_drawRectangle)
      
      dc.DrawRectangle(wxRect(point.x, point.y - m_center, m_width, m_height));  

    wxBitmap bitmap = m_image->GetBitmap();
    bitmapDC.SelectObject(bitmap);
      
    dc.Blit(point.x + m_imageBorderWidth, point.y - m_center + m_imageBorderWidth, m_width - 2 * m_imageBorderWidth, m_height - 2 * m_imageBorderWidth, &bitmapDC, 0, 0);
  }
  else
    // The cell isn't drawn => No need to keep it's image cache for now.
    ClearCache();

  MathCell::Draw(parser, point, fontsize);
}
Exemplo n.º 7
0
void SlideShow::MarkAsDeleted()
{
  // Stop and unregister the timer.
  StopTimer();
  ClearCache();
  Cell::MarkAsDeleted();
}
Exemplo n.º 8
0
c4_HandlerSeq::~c4_HandlerSeq()
{
    const bool rootLevel = _parent == this;
    c4_Persist *pers = _persist;

    if (rootLevel && pers != 0) {
        pers->DoAutoCommit();
    }

    DetachFromParent();
    DetachFromStorage(true);

    for (int i = 0; i < NumHandlers(); ++i) {
        delete  &NthHandler(i);
    }
    _handlers.SetSize(0);

    ClearCache();

    if (rootLevel) {
        delete _field;

        d4_assert(pers != 0);
        delete pers;
    }
}
Exemplo n.º 9
0
ChEXPORT SsrwOOCacheStream::SsrwOOCacheStream(Stream* in_pStream)
{
    ChLOG_DEBUG_START_FN;
    m_pStream = in_pStream;
    m_pStringTmp = NULL;
	ClearCache();
}
Exemplo n.º 10
0
BoxBrowser::~BoxBrowser()
{
	for( int i = 0; i < NUM_BOXES; i++ )
	{
		delete box[ i ];
	}

	delete gameText;
//	delete zIdTxt;
	delete noCoverdata;

	ClearCache();

	if( bgImg1 )
		delete bgImg1;

	if( bgImg2 )
		delete bgImg2;

//	if( ratingImg )
//		delete ratingImg;

//	if( ratingImgData )
//		delete ratingImgData;
}
Exemplo n.º 11
0
//shifts the image datas to a different box and shifts the index
void BoxBrowser::Shift( int num )
{
	//shift list index
	listIdx -= num;
	if( listIdx >= GameList::Count() )
	{
		listIdx = 0;
	}
	else if( listIdx < 0 )
	{
		listIdx = GameList::Count() - 1;
	}

	// check cache size
	// probably could be more elegant than this, but this should work for now
	if( coverImg.size() + abs(num) > BB_MAX_CACHE )
		ClearCache( false );

	//assign new image to boxes
	int lOff = ( NUM_BOXES / 2 );
	for( int i = 0; i < NUM_BOXES; i++ )
	{
		u32 cvrIdx = ( ( ( listIdx ) + i ) % GameList::Count() );
		box[ i ]->SetImage( Get( cvrIdx ) );

		if( i == lOff )
		{
			//set title text
			currentSelection = cvrIdx;
			gameText->SetText( GameList::Name( currentSelection ).c_str() );
		}
	}
	//RsxMem::PrintInfo( true );
}
Exemplo n.º 12
0
const FileStatusCacheEntry * GitFolderStatus::GetCachedItem(const CTGitPath& filepath)
{
	sCacheKey.assign(filepath.GetWinPath());
	FileStatusMap::const_iterator iter;
	const FileStatusCacheEntry *retVal;

	if(m_mostRecentPath.IsEquivalentTo(CTGitPath(sCacheKey.c_str())))
	{
		// We've hit the same result as we were asked for last time
		CTraceToOutputDebugString::Instance()(_T(__FUNCTION__) _T(": fast cache hit for %s\n"), filepath.GetWinPath());
		retVal = m_mostRecentStatus;
	}
	else if ((iter = m_cache.find(sCacheKey)) != m_cache.end())
	{
		CTraceToOutputDebugString::Instance()(_T(__FUNCTION__) _T(": cache found for %s\n"), filepath.GetWinPath());
		retVal = &iter->second;
		m_mostRecentStatus = retVal;
		m_mostRecentPath = CTGitPath(sCacheKey.c_str());
	}
	else
	{
		retVal = NULL;
	}

	if(retVal != NULL)
	{
		// We found something in a cache - check that the cache is not timed-out or force-invalidated
		DWORD now = GetTickCount();

		if ((now >= m_TimeStamp)&&((now - m_TimeStamp) > GetTimeoutValue()))
		{
			// Cache is timed-out
			CTraceToOutputDebugString::Instance()(__FUNCTION__ ": Cache timed-out\n");
			ClearCache();
			retVal = NULL;
		}
		else if(WaitForSingleObject(m_hInvalidationEvent, 0) == WAIT_OBJECT_0)
		{
			// TortoiseGitProc has just done something which has invalidated the cache
			CTraceToOutputDebugString::Instance()(__FUNCTION__ ": Cache invalidated\n");
			ClearCache();
			retVal = NULL;
		}
		return retVal;
	}
	return NULL;
}
Exemplo n.º 13
0
void SlideShow::Draw(wxPoint point)
{
  Cell::Draw(point);
  // If the animation leaves the screen the timer is stopped automatically.
  if(m_animationRunning)
    ReloadTimer();
  
  if (DrawThisCell(point) && (m_images[m_displayed] != NULL))
  {
    // Start the timer once the animation appears on the screen.
    // But start it only once: Else the animation could be refreshed
    // more frequent than it can be drawn. Each update of the animation
    // will trigger this function and will trigger the animation to be
    // restarted anyway.
    //
    Configuration *configuration = (*m_configuration);
    if(configuration->GetPrinting()) {
        m_images[m_displayed]->Recalculate(configuration->GetZoomFactor() * PRINT_SIZE_MULTIPLIER);
    } else {
      m_images[m_displayed]->Recalculate();
    }
    
    if (!InUpdateRegion()) return;
    
    wxDC *dc = configuration->GetDC();
    wxMemoryDC bitmapDC;

    // Slide show cells have a red border except if they are selected
    if (m_drawBoundingBox)
      dc->SetPen(*(wxThePenList->FindOrCreatePen(configuration->GetColor(TS_SELECTION))));
    else
      dc->SetPen(*wxRED_PEN);

    dc->DrawRectangle(wxRect(point.x, point.y - m_center, m_width, m_height));

    wxBitmap bitmap = (configuration->GetPrinting() ? m_images[m_displayed]->GetBitmap(configuration->GetZoomFactor() * PRINT_SIZE_MULTIPLIER) : m_images[m_displayed]->GetBitmap());
    bitmapDC.SelectObject(bitmap);

    int imageBorderWidth = m_imageBorderWidth;
    if (m_drawBoundingBox)
    {
      imageBorderWidth = Scale_Px(3);
      dc->SetBrush(*(wxTheBrushList->FindOrCreateBrush(configuration->GetColor(TS_SELECTION))));
      dc->DrawRectangle(wxRect(point.x, point.y - m_center, m_width, m_height));
    }

    dc->Blit(point.x + imageBorderWidth, point.y - m_center + imageBorderWidth,
             m_width - 2 * imageBorderWidth, m_height - 2 * imageBorderWidth,
             &bitmapDC,
             imageBorderWidth - m_imageBorderWidth, imageBorderWidth - m_imageBorderWidth);

  }
  else
    // The cell isn't drawn => No need to keep it's image cache for now.
    ClearCache();

  // If we need a selection border on another redraw we will be informed by OnPaint() again.
  m_drawBoundingBox = false;
}
Exemplo n.º 14
0
void MEmblemMgr::Destroy()
{
	if (CheckSaveFlag())
		SaveCache();

	ClearCache();
	m_HttpSpooler.Destroy();
}
Exemplo n.º 15
0
ProfileManager::~ProfileManager()
{
    // If the profiles have been altered then write out the profile file
    if (Changed)
        SaveCache();

    ClearCache();
}
Exemplo n.º 16
0
EXPORT_C void  CHuiFxEngine::SetMemoryLevel(THuiMemoryLevel aLevel)
    {
    iLowGraphicsMemoryMode = aLevel;
    if(iLowGraphicsMemoryMode < EHuiMemoryLevelReduced)
        {
        ClearCache();
        }
    }
Exemplo n.º 17
0
	void Core_Imp::DrawSceneToWindowWithTransition(CoreScene* nextScene, CoreScene* previousScene, CoreTransition* transition)
	{
		auto t = (CoreTransition_Imp*) transition;

		m_graphics->SetRenderTarget(nullptr, nullptr);

		t->DrawCache(layerRenderer, nextScene, previousScene);
		t->ClearCache();
	}
Exemplo n.º 18
0
c4_Sequence::~c4_Sequence() {
  d4_assert(_refCount == 0);

  d4_assert(!_dependencies); // there can be no dependencies left

  ClearCache();

  delete _tempBuf;
}
Exemplo n.º 19
0
void LexicalReorderingTableTree::InitializeForInput(const InputType& input){
  ClearCache();
  if(ConfusionNet const* cn = dynamic_cast<ConfusionNet const*>(&input)){
    Cache(*cn);
  } else if(Sentence const* s = dynamic_cast<Sentence const*>(&input)){
    // Cache(*s); ... this just takes up too much memory, we cache elsewhere
    DisableCache();
  }
};
Exemplo n.º 20
0
void SsrwOOCacheStream::ClearCacheAndResync()
{
	if (m_bytesCached>0)
	{
		unsigned long pos = this->getPos(); // find out where we think we are in the stream
		ClearCache();
		this->raw_seek(pos, SsrwOO_START); // and get the underlying stream to the right point
	}
}
Exemplo n.º 21
0
bool
TopographyFile::Update(const WindowProjection &map_projection)
{
  if (IsEmpty())
    return false;

  if (map_projection.GetMapScale() > scale_threshold)
    /* not visible, don't update cache now */
    return false;

  const GeoBounds screenRect =
    map_projection.GetScreenBounds();
  if (cache_bounds.IsValid() && cache_bounds.IsInside(screenRect))
    /* the cache is still fresh */
    return false;

  cache_bounds = map_projection.GetScreenBounds().Scale(fixed(2));

  rectObj deg_bounds = ConvertRect(cache_bounds);

  // Test which shapes are inside the given bounds and save the
  // status to file.status
  msShapefileWhichShapes(&file, dir, deg_bounds, 0);

  // If not a single shape is inside the bounds
  if (!file.status) {
    // ... clear the whole buffer
    ClearCache();
    return false;
  }

  // Iterate through the shapefile entries
  const ShapeList **current = &first;
  auto it = shapes.begin();
  for (int i = 0; i < file.numshapes; ++i, ++it) {
    if (!msGetBit(file.status, i)) {
      // If the shape is outside the bounds
      // delete the shape from the cache
      delete it->shape;
      it->shape = NULL;
    } else {
      // is inside the bounds
      if (it->shape == NULL)
        // shape isn't cached yet -> cache the shape
        it->shape = new XShape(&file, i, label_field);
      // update list pointer
      *current = it;
      current = &it->next;
    }
  }
  // end of list marker
  *current = NULL;

  ++serial;
  return true;
}
Exemplo n.º 22
0
void cImage::Allocate( const Uint32& size, eeColorA DefaultColor, bool memsetData ) {
	ClearCache();

	mPixels = eeNewArray( unsigned char, size );
	mSize 	= size;

	if ( memsetData ) {
		memset( mPixels, (int)DefaultColor.GetValue(), size );
	}
}
Exemplo n.º 23
0
NS_IMETHODIMP nsXULTreeAccessible::Shutdown()
{
  nsXULSelectableAccessible::Shutdown();

  if (mAccessNodeCache) {
    ClearCache(*mAccessNodeCache);
    delete mAccessNodeCache;
    mAccessNodeCache = nsnull;
  }
  return NS_OK;
}
Exemplo n.º 24
0
void *Z_Malloc(int size, int tag, void *user)
{
    memblock_t *newblock;
    unsigned char *data;
    void *result;

    if (tag < 0 || tag >= PU_NUM_TAGS || tag == PU_FREE)
    {
        I_Error("Z_Malloc: attempted to allocate a block with an invalid "
                "tag: %i", tag);
    }

    if (user == NULL && tag >= PU_PURGELEVEL)
    {
        I_Error ("Z_Malloc: an owner is required for purgable blocks");
    }

    // Malloc a block of the required size
    
    newblock = NULL;

    while (newblock == NULL)
    {
        newblock = (memblock_t *) malloc(sizeof(memblock_t) + size);

        if (newblock == NULL)
        {
            if (!ClearCache(sizeof(memblock_t) + size))
            {
                I_Error("Z_Malloc: failed on allocation of %i bytes", size);
            }
        }
    }

    newblock->tag = tag;
    
    // Hook into the linked list for this tag type

    newblock->id = ZONEID;
    newblock->user = user;
    newblock->size = size;

    Z_InsertBlock(newblock);

    data = (unsigned char *) newblock;
    result = data + sizeof(memblock_t);

    if (user != NULL)
    {
        *newblock->user = result;
    }
    
    return result;
}
Exemplo n.º 25
0
	SpriteRenderer3D::~SpriteRenderer3D()
	{
		ClearCache();

		m_vertexBuffer.reset();
		m_indexBuffer.reset();
		m_shader_nt.reset();
		m_shader.reset();

		SafeRelease(m_graphics);
	}
Exemplo n.º 26
0
void Jit::Compile(u32 em_address)
{
	if (GetSpaceLeft() < 0x10000 || blocks.IsFull())
	{
		ClearCache();
	}

	int block_num = blocks.AllocateBlock(em_address);
	JitBlock *b = blocks.GetBlock(block_num);
	blocks.FinalizeBlock(block_num, jo.enableBlocklink, DoJit(em_address, b));
}
Exemplo n.º 27
0
ConvexTriangleCallback::ConvexTriangleCallback(Dispatcher*  dispatcher,BroadphaseProxy* proxy0,BroadphaseProxy* proxy1):
  m_convexProxy(proxy0),m_triangleProxy(*proxy1),m_dispatcher(dispatcher),
	m_dispatchInfoPtr(0)
{

	  //
	  // create the manifold from the dispatcher 'manifold pool'
	  //
	  m_manifoldPtr = m_dispatcher->GetNewManifold(proxy0->m_clientObject,proxy1->m_clientObject);

  	  ClearCache();
}
Exemplo n.º 28
0
TopographyFile::~TopographyFile()
{
  if (IsEmpty())
    return;

  ClearCache();
  msShapefileClose(&file);

  if (dir != NULL) {
    --dir->refcount;
    zzip_dir_free(dir);
  }
}
Exemplo n.º 29
0
void ClangCodeCompletion::OnBuildEnded(clBuildEvent& e)
{
    e.Skip();
    CHECK_CLANG_ENABLED_RET();

    // Clear environment variables previously set by this class
    ::wxUnsetEnv("CL_COMPILATION_DB");
    ::wxUnsetEnv("CXX");
    ::wxUnsetEnv("CC");

    // Clear the TU cache
    ClearCache();
}
Exemplo n.º 30
0
void Jit::Compile(u32 em_address)
{
	if (GetSpaceLeft() < 0x10000 || blocks.IsFull())
	{
		ClearCache();
	}

	int block_num = blocks.AllocateBlock(em_address);
	JitBlock *b = blocks.GetBlock(block_num);
	DoJit(em_address, b);
	blocks.FinalizeBlock(block_num, jo.enableBlocklink);

	// Drat.  The VFPU hit an uneaten prefix at the end of a block.
	if (js.startDefaultPrefix && js.MayHavePrefix()) {
		WARN_LOG(JIT, "Uneaten prefix at end of block: %08x", js.compilerPC - 4);
		js.startDefaultPrefix = false;
		// Our assumptions are all wrong so it's clean-slate time.
		ClearCache();

		// Let's try that one more time.  We won't get back here because we toggled the value.
		Compile(em_address);
	}
}