cocos2d-x  3.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
CCAllocatorStrategyGlobalSmallBlock.h File Reference

Classes

class  AllocatorStrategyGlobalSmallBlock
 

Namespaces

 cocos2d
 Add deprecated global functions and variables here.
 

Macros

#define TRACK(...)
#define SType(size)   AllocatorStrategyFixedBlock<size>
#define SBA(n, size)
#define ALLOCATE(slot, size)
#define OWNS(slot, S, address)
#define DEALLOCATE(slot, size, address)

Macro Definition Documentation

#define ALLOCATE (   slot,
  size 
)
Value:
case size: \
{ \
void* v = _smallBlockAllocators[slot]; \
CC_ASSERT(nullptr != v); \
auto a = (SType(size)*)v; \
address = a->allocate(adjusted_size); \
TRACK(slot, size, +=); \
} \
break;
#define SType(size)
Definition: CCAllocatorStrategyGlobalSmallBlock.h:63
#define CC_ASSERT(cond)
Definition: CCPlatformDefine-android.h:52
#define TRACK(...)
Definition: CCAllocatorStrategyGlobalSmallBlock.h:47
var ALLOCATE (   var,
  var 
)
Value:
case size: \
{ \
void* v = _smallBlockAllocators[slot]; \
CC_ASSERT(nullptr != v); \
auto a = (SType(size)*)v; \
address = a->allocate(adjusted_size); \
TRACK(slot, size, +=); \
} \
break;
#define SType(size)
Definition: CCAllocatorStrategyGlobalSmallBlock.h:63
#define CC_ASSERT(cond)
Definition: CCPlatformDefine-android.h:52
#define TRACK(...)
Definition: CCAllocatorStrategyGlobalSmallBlock.h:47
local ALLOCATE (   local,
  local 
)
Value:
case size: \
{ \
void* v = _smallBlockAllocators[slot]; \
CC_ASSERT(nullptr != v); \
auto a = (SType(size)*)v; \
address = a->allocate(adjusted_size); \
TRACK(slot, size, +=); \
} \
break;
#define SType(size)
Definition: CCAllocatorStrategyGlobalSmallBlock.h:63
#define CC_ASSERT(cond)
Definition: CCPlatformDefine-android.h:52
#define TRACK(...)
Definition: CCAllocatorStrategyGlobalSmallBlock.h:47
#define DEALLOCATE (   slot,
  size,
  address 
)
Value:
case size: \
{ \
void* v = _smallBlockAllocators[slot]; \
CC_ASSERT(nullptr != v); \
auto a = (SType(size)*)v; \
a->deallocate(address, size); \
TRACK(slot, size, -=); \
} \
break;
#define SType(size)
Definition: CCAllocatorStrategyGlobalSmallBlock.h:63
#define CC_ASSERT(cond)
Definition: CCPlatformDefine-android.h:52
#define TRACK(...)
Definition: CCAllocatorStrategyGlobalSmallBlock.h:47
var DEALLOCATE (   var,
  var,
  var 
)
Value:
case size: \
{ \
void* v = _smallBlockAllocators[slot]; \
CC_ASSERT(nullptr != v); \
auto a = (SType(size)*)v; \
a->deallocate(address, size); \
TRACK(slot, size, -=); \
} \
break;
#define SType(size)
Definition: CCAllocatorStrategyGlobalSmallBlock.h:63
#define CC_ASSERT(cond)
Definition: CCPlatformDefine-android.h:52
#define TRACK(...)
Definition: CCAllocatorStrategyGlobalSmallBlock.h:47
local DEALLOCATE (   local,
  local,
  local 
)
Value:
case size: \
{ \
void* v = _smallBlockAllocators[slot]; \
CC_ASSERT(nullptr != v); \
auto a = (SType(size)*)v; \
a->deallocate(address, size); \
TRACK(slot, size, -=); \
} \
break;
#define SType(size)
Definition: CCAllocatorStrategyGlobalSmallBlock.h:63
#define CC_ASSERT(cond)
Definition: CCPlatformDefine-android.h:52
#define TRACK(...)
Definition: CCAllocatorStrategyGlobalSmallBlock.h:47
#define OWNS (   slot,
  S,
  address 
)
Value:
case S: \
{ \
void* v = _smallBlockAllocators[slot]; \
if (v) \
{ \
auto a = (SType(S)*)v; \
if (a->owns(address)) \
{ \
size = SType(S)::block_size; \
break; \
} \
} \
}
#define SType(size)
Definition: CCAllocatorStrategyGlobalSmallBlock.h:63
var OWNS (   var,
  var,
  var 
)
Value:
case S: \
{ \
void* v = _smallBlockAllocators[slot]; \
if (v) \
{ \
auto a = (SType(S)*)v; \
if (a->owns(address)) \
{ \
size = SType(S)::block_size; \
break; \
} \
} \
}
#define SType(size)
Definition: CCAllocatorStrategyGlobalSmallBlock.h:63
local OWNS (   local,
  local,
  local 
)
Value:
case S: \
{ \
void* v = _smallBlockAllocators[slot]; \
if (v) \
{ \
auto a = (SType(S)*)v; \
if (a->owns(address)) \
{ \
size = SType(S)::block_size; \
break; \
} \
} \
}
#define SType(size)
Definition: CCAllocatorStrategyGlobalSmallBlock.h:63
#define SBA (   n,
  size 
)
Value:
if (size <= _maxBlockSize) \
{ \
auto v = ccAllocatorGlobal.allocate(sizeof(SType(size))); \
_smallBlockAllocators[n] = (AllocatorBase*)(new (v) SType(size)("GlobalSmallBlock::"#size)); \
}
#define SType(size)
Definition: CCAllocatorStrategyGlobalSmallBlock.h:63
NS_CC_ALLOCATOR_BEGIN CC_ALLOCATOR_GLOBAL ccAllocatorGlobal
var SBA (   var,
  var 
)
Value:
if (size <= _maxBlockSize) \
{ \
auto v = ccAllocatorGlobal.allocate(sizeof(SType(size))); \
_smallBlockAllocators[n] = (AllocatorBase*)(new (v) SType(size)("GlobalSmallBlock::"#size)); \
}
#define SType(size)
Definition: CCAllocatorStrategyGlobalSmallBlock.h:63
NS_CC_ALLOCATOR_BEGIN CC_ALLOCATOR_GLOBAL ccAllocatorGlobal
local SBA (   local,
  local 
)
Value:
if (size <= _maxBlockSize) \
{ \
auto v = ccAllocatorGlobal.allocate(sizeof(SType(size))); \
_smallBlockAllocators[n] = (AllocatorBase*)(new (v) SType(size)("GlobalSmallBlock::"#size)); \
}
#define SType(size)
Definition: CCAllocatorStrategyGlobalSmallBlock.h:63
NS_CC_ALLOCATOR_BEGIN CC_ALLOCATOR_GLOBAL ccAllocatorGlobal
#define SType (   size)    AllocatorStrategyFixedBlock<size>
var SType (   var)    AllocatorStrategyFixedBlock<size>
local SType (   local)    AllocatorStrategyFixedBlock<size>
#define TRACK (   ...)
var TRACK (   ...)
local TRACK (   ...)