Exemple #1
0
        public void DecRefCount(StackValue sv)
        {
            if (!StackUtils.IsReferenceType(sv))
            {
                return;
            }

            int ptr = (int)sv.opdata;

            Debug.Assert(this.Heaplist[ptr].Refcount > 0);
            this.Heaplist[ptr].Refcount--;
        }
Exemple #2
0
        public bool IsTemporaryPointer(StackValue sv)
        {
            if (!StackUtils.IsReferenceType(sv))
            {
                return(false);
            }

            int         ptr = (int)sv.opdata;
            HeapElement he  = this.Heaplist[ptr];

            return(he.Active && he.Refcount == 0);
        }
Exemple #3
0
        public void IncRefCount(StackValue sv)
        {
            if (!StackUtils.IsReferenceType(sv))
            {
                return;
            }

            int ptr = (int)sv.opdata;

            this.Heaplist[ptr].Refcount++;
            if (this.Heaplist[ptr].Refcount > 0)
            {
                this.Heaplist[ptr].Active = true;
            }
        }