memory improvements in intellisense

This commit is contained in:
Бондарев Иван 2017-12-30 15:46:38 +01:00
parent d185cd8de6
commit d4fd6f88e5
6 changed files with 20 additions and 17 deletions

View file

@ -1127,6 +1127,11 @@ namespace CodeCompletion
if (tmp_cur_used_assemblies != null)
PascalABCCompiler.NetHelper.NetHelper.cur_used_assemblies = tmp_cur_used_assemblies;
}
~DomConverter()
{
}
}
}

View file

@ -63,7 +63,7 @@ namespace CodeCompletion
#if DEBUG
File.AppendAllText("log.txt", e.Message + Environment.NewLine + e.StackTrace + Environment.NewLine);
#endif
throw e;
//throw e;
//System.Diagnostics.Debug.WriteLine(e.StackTrace);
}
}
@ -1971,9 +1971,7 @@ namespace CodeCompletion
if (add_doc_from_text && this.converter.controller.docs != null && this.converter.controller.docs.ContainsKey(_unit_module.unit_name))
cur_scope.AddDocumentation(this.converter.controller.docs[_unit_module.unit_name]);
entry_scope = cur_scope;
//add_standart_types();
if (_unit_module.unit_name.idunit_name.name == this.converter.controller.Parser.LanguageInformation.SystemUnitName)
//add_system_unit();
{
is_system_unit = true;
add_standart_types(entry_scope);
@ -1993,8 +1991,6 @@ namespace CodeCompletion
ns_cache[s] = s;
}
}
//if (parse_only_interface)
// return;
if (_unit_module.implementation_part != null)
_unit_module.implementation_part.visit(this);
if (_unit_module.initialization_part != null)
@ -2003,11 +1999,6 @@ namespace CodeCompletion
SymScope stmt_scope = new BlockScope(cur_scope);
cur_scope.AddName("$block_scope",stmt_scope);
stmt_scope.loc = get_location(_unit_module.initialization_part);
/*if (_unit_module.implementation_part != null)
{
cur_scope.loc.end_line_num = entry_scope.loc.end_line_num;
cur_scope.loc.end_column_num = entry_scope.loc.end_column_num;
}*/
cur_scope = stmt_scope;
_unit_module.initialization_part.visit(this);
cur_scope = tmp;
@ -2018,11 +2009,6 @@ namespace CodeCompletion
SymScope stmt_scope = new BlockScope(cur_scope);
cur_scope.AddName("$block_scope",stmt_scope);
stmt_scope.loc = get_location(_unit_module.finalization_part);
/*if (_unit_module.implementation_part != null)
{
cur_scope.loc.end_line_num = entry_scope.loc.end_line_num;
cur_scope.loc.end_column_num =entry_scope.loc.end_column_num;
}*/
cur_scope = stmt_scope;
_unit_module.finalization_part.visit(this);
cur_scope = tmp;

View file

@ -201,7 +201,9 @@ namespace CodeCompletion
foreach (ProcScope meth in meths)
ts.RemoveExtensionMethod(ts, meth);
}
extension_methods.Clear();
}
UnitDocCache.RemoveItem(this);
declaringUnit = null;
topScope = null;
}
@ -1020,6 +1022,11 @@ namespace CodeCompletion
si.description = this.ToString();
}
~InterfaceUnitScope()
{
}
IImplementationUnitScope IInterfaceUnitScope.ImplementationUnitScope
{
get

View file

@ -360,6 +360,11 @@ namespace CodeCompletion
{
elem_cache.Add(value);
}
public static void RemoveItem(SymScope item)
{
elem_cache.Remove(item);
}
}
}

View file

@ -1,4 +1,4 @@
unit SyntaxTree;
unit SyntaxTree;
interface

View file

@ -244,7 +244,7 @@ namespace VisualPascalABC
}
}
}
if (is_comp && Environment.WorkingSet > 60000000 /*&& mem_delta > 10000000*/)
if (is_comp && mem_delta > 20000000 /*&& mem_delta > 10000000*/)
//postavil delta dlja pamjati, posle kototoj delaetsja sborka musora
{
mem_delta = 0;