1
0
mirror of https://github.com/gnosygnu/xowa.git synced 2026-03-02 03:49:30 +00:00

'v3.8.5.1'

This commit is contained in:
gnosygnu
2016-08-29 23:31:58 -04:00
parent e4a2af026b
commit 232838c732
292 changed files with 4502 additions and 1838 deletions

View File

@@ -24,13 +24,12 @@ public class Xow_cache_mgr {
this.wiki = wiki;
this.page_cache = new Xow_page_cache(wiki);
this.defn_cache = new Xow_defn_cache(wiki.Lang());
this.lst_cache = new Xow_defn_cache(wiki.Lang());
}
public Hash_adp Tmpl_result_cache() {return tmpl_result_cache;} private final Hash_adp tmpl_result_cache = Hash_adp_bry.cs();
public Xow_page_cache Page_cache() {return page_cache;} private Xow_page_cache page_cache;
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_bry Lst_cache() {return lst_cache;} private final Hash_adp_bry lst_cache = Hash_adp_bry.cs();
public Hash_adp Misc_cache() {return misc_cache;} private final Hash_adp misc_cache = Hash_adp_.New();
public Xow_page_cache Page_cache() {return page_cache;} private Xow_page_cache page_cache;
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);
@@ -62,7 +61,7 @@ public class Xow_cache_mgr {
tmpl_result_cache.Clear();
defn_cache.Free_mem_all();
misc_cache.Clear();
lst_cache.Free_mem_all();
lst_cache.Clear();
scrib_lang_names = null;
}
private static Keyval[] scrib_lang_names;

View File

@@ -20,17 +20,16 @@ import gplx.core.intls.*; import gplx.core.caches.*;
import gplx.xowa.langs.*;
import gplx.xowa.wikis.nss.*;
import gplx.xowa.parsers.tmpls.*;
public class Xow_defn_cache { // stores compiled Xot_defn
private Xol_lang_itm lang; // needed to lowercase names;
private Bry_bfr upper_1st_bfr = Bry_bfr_.Reset(255);
private Gfo_cache_mgr cache = new Gfo_cache_mgr().Max_size_(64 * 1024 * 1024).Reduce_by_(32 * 1024 * 1024);
public class Xow_defn_cache { // stores compiled Xot_defn
private final Xol_lang_itm lang; // needed to lowercase names;
private final Bry_bfr upper_1st_bfr = Bry_bfr_.Reset(255);
private final Gfo_cache_mgr cache = new Gfo_cache_mgr().Max_size_(64 * 1024 * 1024).Reduce_by_(32 * 1024 * 1024);
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 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;
cache.Add_replace(name, defn, cache_size);
cache.Add_replace(name, defn, defn.Cache_size());
if (case_match == Xow_ns_case_.Tid__1st) {
name = lang.Case_mgr().Case_build_1st_upper(upper_1st_bfr, name, 0, name.length);
cache.Add_replace(name, defn, 0);