示例#1
0
 static GCHeapObj()
 {
     NullObj = new GCHeapObj()
     {
         Addr = 0
     };
 }
示例#2
0
        public GCHeapObj AllocObj(TypeObject typeObject)
        {
            GCHeapObj heapObj = new GCHeapObj()
            {
                Addr      = _nxtfreeSlt,
                TypeToken = typeObject.Token,
                Val       = null
            };

            _htable.Add(_nxtfreeSlt, heapObj);
            Interlocked.Increment(ref _nxtfreeSlt);
            return(heapObj);
        }
示例#3
0
        //public GCHeapObj AllocObjType()
        //{
        //    return AllocObj(null);
        //}

        public GCHeapObj GetObj(Int32 addr)
        {
            GCHeapObj obj = null;

            lock (htableLocker)
            {
                if (_htable.ContainsKey(addr))
                {
                    obj = _htable[addr];
                }

                if (obj != null && !obj.IsGCollected)
                {
                    return(obj);
                }
                else
                {
                    return(GCHeapObj.NullObj);
                }
            }
        }