Mercurial > hg > octave-lyh
diff src/variables.cc @ 3005:fd2080b2800e
[project @ 1997-05-24 17:37:39 by jwe]
author | jwe |
---|---|
date | Sat, 24 May 1997 17:38:55 +0000 |
parents | aa9d0c0e0458 |
children | 2ad9af85b89b |
line wrap: on
line diff
--- a/src/variables.cc +++ b/src/variables.cc @@ -117,10 +117,10 @@ initialize_symbol_tables (void) { if (! global_sym_tab) - global_sym_tab = new symbol_table (); + global_sym_tab = new symbol_table (2048); if (! top_level_sym_tab) - top_level_sym_tab = new symbol_table (); + top_level_sym_tab = new symbol_table (4096); curr_sym_tab = top_level_sym_tab; } @@ -1512,7 +1512,7 @@ void bind_builtin_variable (const string& varname, const octave_value& val, bool protect, bool eternal, - symbol_record::sv_function sv_fcn, + symbol_record::change_function chg_fcn, const string& help) { symbol_record *sr = global_sym_tab->lookup (varname, true); @@ -1528,8 +1528,8 @@ // variable function only if it knows about it, and it needs to, so // that user prefs can be properly initialized. - if (sv_fcn) - sr->set_sv_function (sv_fcn); + if (chg_fcn) + sr->set_change_function (chg_fcn); sr->define_builtin_var (val); @@ -1788,6 +1788,30 @@ return retval; } +DEFUN (__dump_symtab_info__, args, , + "__dump_symtab_info__ (): print raw symbol table statistices") +{ + octave_value_list retval; + + int nargin = args.length (); + + if (nargin == 1) + { + string arg = args(0).string_value (); + + if (arg == "global") + global_sym_tab->print_stats (); + else + print_usage ("__dump_symtab_info__"); + } + else if (nargin == 0) + curr_sym_tab->print_stats (); + else + print_usage ("__dump_symtab_info__"); + + return retval; +} + /* ;;; Local Variables: *** ;;; mode: C++ ***