diff --git a/.gitignore b/.gitignore index 14300ff..6aa4673 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,2 @@ *.o -* -*.vscode \ No newline at end of file +*. \ No newline at end of file diff --git a/2Q_cache.h b/2Q_cache.h index b34eab3..77f6fae 100644 --- a/2Q_cache.h +++ b/2Q_cache.h @@ -18,68 +18,78 @@ private: std::list q2; //slow queue - if page asked at the first time put it to q2, if itasked from q2 it put it to q1, public: + int tic_number = 0; + TwoCache(size_t q1sz, size_t q2sz): cpct_q1(q1sz), cpct_q2(q2sz) {} //ctor void put_page(int id) { - std::cout << "id: " << id << std::endl; - //std::cout <<__LINE__ << " " << __FILE__<< std::endl; + //std::cout << "id: " << id << std::endl; if (umap1.find(id) != umap1.end()) { //page is found, nothing to do (fast case) - std::cout << "id ="<