Add EXPCL_PANDADX to classes.

Update some documentation.
This commit is contained in:
aignacio_sf 2006-01-05 19:14:20 +00:00
parent 56d607b8d0
commit 068ae5eed3
2 changed files with 62 additions and 61 deletions

View File

@ -521,8 +521,7 @@ void Lru::access_page (LruPage *lru_page)
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
// Function: Lru::set_maximum_frame_bandwidth_utilization // Function: Lru::set_maximum_frame_bandwidth_utilization
// Access: Public // Access: Public
// Description: This must be called before accessing or using a // Description:
// page since it pages in the page if it is paged out.
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
void Lru::set_maximum_frame_bandwidth_utilization void Lru::set_maximum_frame_bandwidth_utilization
(float maximum_frame_bandwidth_utilization) (float maximum_frame_bandwidth_utilization)
@ -568,8 +567,7 @@ void Lru::update_page_priorities (void)
this->remove_page(lru_page); this->remove_page(lru_page);
priority priority = (( int ) lru_page->_m.priority + lru_page->_m.priority_change);
= (( int ) lru_page->_m.priority + lru_page->_m.priority_change);
if(priority < 0) { if(priority < 0) {
priority = 0; priority = 0;
} }
@ -586,9 +584,15 @@ void Lru::update_page_priorities (void)
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
// Function: Lru::update_lru_page // Function: Lru::update_lru_page
// Access: Public // Access: Public
// Description: This updates the page's average utilization and // Description: This updates the page's average utilization.
// adds it to the array of pages with changed // Priority LPP_New is considered to be average usage
// priorities if there was a change in priority. // of 1.0 (which means the page is used once per frame
// on average). Priorities < LPP_New are for pages
// used more than once per frame and Priorities >
// LPP_New are for pages used less than once per frame.
// If there was a change in priority, then adds it to
// the array of lru pages with changed priorities
// which will be updated later.
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
void Lru::update_lru_page (LruPage *lru_page) void Lru::update_lru_page (LruPage *lru_page)
{ {
@ -604,11 +608,9 @@ void Lru::update_lru_page (LruPage *lru_page)
if(lru_page->_m.lock == false && lru_page->_m.in_cache) { if(lru_page->_m.lock == false && lru_page->_m.in_cache) {
int delta_priority; int delta_priority;
int lifetime_frames;
delta_priority = 0; delta_priority = 0;
// if (lru_page -> _m.total_usage > 0)
{
int lifetime_frames;
lifetime_frames = this->_m.current_frame_identifier - lifetime_frames = this->_m.current_frame_identifier -
lru_page->_m.first_frame_identifier; lru_page->_m.first_frame_identifier;
@ -667,7 +669,6 @@ void Lru::update_lru_page (LruPage *lru_page)
lru_page->_m.update_frame_identifier = this->_m.current_frame_identifier; lru_page->_m.update_frame_identifier = this->_m.current_frame_identifier;
lru_page->_m.update_total_usage = 0; lru_page->_m.update_total_usage = 0;
} }
}
if(lru_page->_m.priority_change) { if(lru_page->_m.priority_change) {
if(this->_m.total_lru_page_priority_changes if(this->_m.total_lru_page_priority_changes

View File

@ -69,7 +69,7 @@ PageTypeStatistics;
typedef bool (*LruPageTypeFunction) (LruPage *lru_page); typedef bool (*LruPageTypeFunction) (LruPage *lru_page);
class LruPage class EXPCL_PANDADX LruPage
{ {
protected: protected:
@ -150,7 +150,7 @@ public:
// is not enough memory available, then the lowest priority pages // is not enough memory available, then the lowest priority pages
// will be paged out first until there is enough memory available. // will be paged out first until there is enough memory available.
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
class Lru class EXPCL_PANDADX Lru
{ {
public: public: