ZFFramework
Loading...
Searching...
No Matches
Macros
ZFThread_zfautoRelease.h File Reference

thread utility More...

#include "ZFThread.h"

Go to the source code of this file.

Macros

#define zfautoRelease(obj)
 make object autorelease, which would be released by the owner thread
 
#define zfautoRelease(obj)
 make object autorelease, which would be released by the owner thread
 

Detailed Description

thread utility

Macro Definition Documentation

◆ zfautoRelease [1/2]

#define zfautoRelease ( obj)

make object autorelease, which would be released by the owner thread

calling this function will add the object to current thread's autorelease pool
assert failure if current thread isn't started or registered by ZFThread
note that which time to release the objects in pool, is depends on implementation

See also
zfRetain, zfRelease

ADVANCED:
this method depends on ZFThread's implementation
if no ZFThread's implementation found, we'll try to add to global memory pool (see ZFAutoReleasePool::instance), which should be drained manually

so, try not to abuse this method, since:

  • the actual behavior depends on ZFThread's implementation
  • it have lower performance than other release methods (see ZFObject for more info about other release methods)
See also
zfautoRelease

◆ zfautoRelease [2/2]

#define zfautoRelease ( obj)

make object autorelease, which would be released by the owner thread

calling this function will add the object to current thread's autorelease pool
assert failure if current thread isn't started or registered by ZFThread
note that which time to release the objects in pool, is depends on implementation

See also
zfRetain, zfRelease

ADVANCED:
this method depends on ZFThread's implementation
if no ZFThread's implementation found, we'll try to add to global memory pool (see ZFAutoReleasePool::instance), which should be drained manually

so, try not to abuse this method, since:

  • the actual behavior depends on ZFThread's implementation
  • it have lower performance than other release methods (see ZFObject for more info about other release methods)
See also
zfautoRelease