mirror of
https://github.com/gnosygnu/xowa.git
synced 2026-03-02 03:49:30 +00:00
'v3.7.4.1'
This commit is contained in:
@@ -16,6 +16,7 @@ You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa.wikis.caches; import gplx.*; import gplx.xowa.*; import gplx.xowa.wikis.*;
|
||||
import gplx.core.caches.*;
|
||||
import gplx.xowa.wikis.xwikis.sitelinks.*;
|
||||
public class Xow_cache_mgr {
|
||||
private final Xowe_wiki wiki;
|
||||
@@ -30,7 +31,12 @@ public class Xow_cache_mgr {
|
||||
public Xow_defn_cache Defn_cache() {return defn_cache;} private final Xow_defn_cache defn_cache;
|
||||
public Xow_defn_cache Lst_cache() {return lst_cache;} private final Xow_defn_cache lst_cache;
|
||||
public Hash_adp Misc_cache() {return misc_cache;} private final Hash_adp misc_cache = Hash_adp_.New();
|
||||
public void Page_cache_(Xow_page_cache v) {this.page_cache = v;}
|
||||
public Gfo_cache_mgr Commons_cache() {return commons_cache;} private Gfo_cache_mgr commons_cache = new Gfo_cache_mgr().Max_size_(64 * Io_mgr.Len_mb).Reduce_by_(32 * Io_mgr.Len_mb);
|
||||
public Gfo_cache_mgr Ifexist_cache() {return ifexist_cache;} private Gfo_cache_mgr ifexist_cache = new Gfo_cache_mgr().Max_size_(64 * Io_mgr.Len_mb).Reduce_by_(32 * Io_mgr.Len_mb);
|
||||
|
||||
public Xow_cache_mgr Page_cache_(Xow_page_cache v) {this.page_cache = v; return this;}
|
||||
public Xow_cache_mgr Commons_cache_(Gfo_cache_mgr v) {this.commons_cache = v; return this;}
|
||||
public Xow_cache_mgr Ifexist_cache_(Gfo_cache_mgr v) {this.ifexist_cache = v; return this;}
|
||||
public Keyval[] Scrib_lang_names() {
|
||||
if (scrib_lang_names == null) {
|
||||
List_adp list = List_adp_.New();
|
||||
@@ -47,7 +53,12 @@ public class Xow_cache_mgr {
|
||||
}
|
||||
public void Free_mem_all() {this.Free_mem_all(Bool_.Y);}
|
||||
public void Free_mem_all(boolean free_page_cache) {
|
||||
if (free_page_cache) page_cache.Free_mem_all();
|
||||
if (free_page_cache) {
|
||||
page_cache.Free_mem_all();
|
||||
commons_cache.Clear();
|
||||
ifexist_cache.Clear();
|
||||
wiki.Appe().Wiki_mgr().Wdata_mgr().Clear(); // moved from ctx.Clear(); DATE:2016-07-21
|
||||
}
|
||||
tmpl_result_cache.Clear();
|
||||
defn_cache.Free_mem_all();
|
||||
misc_cache.Clear();
|
||||
|
||||
@@ -27,7 +27,6 @@ public class Xow_defn_cache { // stores compiled Xot_defn
|
||||
public Xow_defn_cache(Xol_lang_itm lang) {this.lang = lang;}
|
||||
public Xot_defn Get_by_key(byte[] name) {return (Xot_defn)cache.Get_by_key(name);}
|
||||
public void Free_mem_all() {cache.Clear();}
|
||||
public void Free_mem_some() {cache.Reduce_recent();}
|
||||
public void Add(Xot_defn defn, byte case_match) {
|
||||
byte[] name = defn.Name();
|
||||
int cache_size = defn.Cache_size(); // OBSOLETE: * 2 b/c it has src and root;
|
||||
|
||||
Reference in New Issue
Block a user