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
// Access: Public
// Description: This must be called before accessing or using a
// page since it pages in the page if it is paged out.
// Description:
////////////////////////////////////////////////////////////////////
void Lru::set_maximum_frame_bandwidth_utilization
(float maximum_frame_bandwidth_utilization)
@ -568,8 +567,7 @@ void Lru::update_page_priorities (void)
this->remove_page(lru_page);
priority
= (( int ) lru_page->_m.priority + lru_page->_m.priority_change);
priority = (( int ) lru_page->_m.priority + lru_page->_m.priority_change);
if(priority < 0) {
priority = 0;
}
@ -577,7 +575,7 @@ void Lru::update_page_priorities (void)
priority = LPP_TotalPriorities - 1;
}
this->add_page(( LruPagePriority ) priority, lru_page);
this->add_page((LruPagePriority) priority, lru_page);
lru_page->_m.priority_change = 0;
}
this->_m.total_lru_page_priority_changes = 0;
@ -586,9 +584,15 @@ void Lru::update_page_priorities (void)
////////////////////////////////////////////////////////////////////
// Function: Lru::update_lru_page
// Access: Public
// Description: This updates the page's average utilization and
// adds it to the array of pages with changed
// priorities if there was a change in priority.
// Description: This updates the page's average utilization.
// Priority LPP_New is considered to be average usage
// 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)
{
@ -604,11 +608,9 @@ void Lru::update_lru_page (LruPage *lru_page)
if(lru_page->_m.lock == false && lru_page->_m.in_cache) {
int delta_priority;
int lifetime_frames;
delta_priority = 0;
// if (lru_page -> _m.total_usage > 0)
{
int lifetime_frames;
lifetime_frames = this->_m.current_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_total_usage = 0;
}
}
if(lru_page->_m.priority_change) {
if(this->_m.total_lru_page_priority_changes

View File

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