mcobject.bi

Defines the semi-managed class

Author

Marcel Sondaar

License

Public Domain

Summary
mcobject.biDefines the semi-managed class
MCObjectProvides basic memory functionality for the library
Variables
mRefcountContains the amount of pending references.
mAutocountAmount of non-ownership references to this object.
mAutoNextPointer to the next object with an autorelease count This pointer forms a linked list of all objects which have a pending release
Functions
RetainClaim (co-)ownership of an object
ReleaseRelease ownership of an object
AutoreleaseRelease ownership of an object, while keeping it temporarily alive for a calling function to reacquire ownership
FlushCalled by a memory management tool to inform that there are no stack references left in use.

MCObject

Provides basic memory functionality for the library

Summary
Variables
mRefcountContains the amount of pending references.
mAutocountAmount of non-ownership references to this object.
mAutoNextPointer to the next object with an autorelease count This pointer forms a linked list of all objects which have a pending release
Functions
RetainClaim (co-)ownership of an object
ReleaseRelease ownership of an object
AutoreleaseRelease ownership of an object, while keeping it temporarily alive for a calling function to reacquire ownership
FlushCalled by a memory management tool to inform that there are no stack references left in use.

Variables

mRefcount

mRefcount As Integer

Contains the amount of pending references.  This field is one at initialisation, and the object will be deleted when its value reaches zero.

mAutocount

mAutocount As Integer

Amount of non-ownership references to this object.  Software should always use a non-ownership reference when passing an MCObject type as a return value

mAutoNext

mAutoNext As MCObject Ptr

Pointer to the next object with an autorelease count This pointer forms a linked list of all objects which have a pending release

Functions

Retain

Declare Sub Retain()

Claim (co-)ownership of an object

Release

Declare Sub Release()

Release ownership of an object

Autorelease

Declare Sub Autorelease()

Release ownership of an object, while keeping it temporarily alive for a calling function to reacquire ownership

Flush

Declare Sub Flush()

Called by a memory management tool to inform that there are no stack references left in use.  Must not be called by application code.

mRefcount As Integer
Contains the amount of pending references.
mAutocount As Integer
Amount of non-ownership references to this object.
mAutoNext As MCObject Ptr
Pointer to the next object with an autorelease count This pointer forms a linked list of all objects which have a pending release
Declare Sub Retain()
Claim (co-)ownership of an object
Declare Sub Release()
Release ownership of an object
Declare Sub Autorelease()
Release ownership of an object, while keeping it temporarily alive for a calling function to reacquire ownership
Declare Sub Flush()
Called by a memory management tool to inform that there are no stack references left in use.