private void Init()
        {
            if (_methodPtrs == null)
            {
                lock (_locker)
                {
                    if (_methodPtrs == null)
                    {
                        var localPtrs = MapType(typeof(TInstance));
                        _methodNumbers = new IdentifiersTrie <int>();
                        for (int idx = 0; idx < localPtrs.Count; ++idx)
                        {
                            var methinfo = localPtrs[idx].MethodInfo;

                            _methodNumbers.Add(methinfo.Name, idx);
                            if (methinfo.Alias != null)
                            {
                                _methodNumbers.Add(methinfo.Alias, idx);
                            }
                        }

                        _methodPtrs = localPtrs;
                    }
                }
            }
        }
Exemple #2
0
        private void InitSearch()
        {
            if (_methodNumbers == null)
            {
                Init();
                _methodNumbers = new IdentifiersTrie <int>();
                for (int idx = 0; idx < _methodPtrs.Count; ++idx)
                {
                    var methinfo = _methodPtrs[idx].MethodInfo;

                    _methodNumbers.Add(methinfo.Name, idx);
                    if (methinfo.Alias != null)
                    {
                        _methodNumbers.Add(methinfo.Alias, idx);
                    }
                }
            }
        }