TexGen
Core
ShinyNodePool.h
Go to the documentation of this file.
1
/*
2
The zlib/libpng License
3
4
Copyright (c) 2007 Aidin Abedi (www.*)
5
6
This software is provided 'as-is', without any express or implied warranty. In no event will
7
the authors be held liable for any damages arising from the use of this software.
8
9
Permission is granted to anyone to use this software for any purpose, including commercial
10
applications, and to alter it and redistribute it freely, subject to the following
11
restrictions:
12
13
1. The origin of this software must not be misrepresented; you must not claim that
14
you wrote the original software. If you use this software in a product,
15
an acknowledgment in the product documentation would be appreciated but is
16
not required.
17
18
2. Altered source versions must be plainly marked as such, and must not be
19
misrepresented as being the original software.
20
21
3. This notice may not be removed or altered from any source distribution.
22
*/
23
24
#ifndef SHINY_NODE_POOL_H
25
#define SHINY_NODE_POOL_H
26
27
#include "
ShinyNode.h
"
28
29
#if SHINY_PROFILER == TRUE
30
namespace
Shiny
{
31
32
33
//-----------------------------------------------------------------------------
34
35
struct
ProfileNodePool
{
36
37
typedef
ProfileNode
T
;
38
39
ProfileNodePool
*
nextPool
;
40
41
T
*
_nextItem
;
42
T
*
endOfItems
;
43
44
T
_items
[1];
45
46
47
T
*
firstItem
(
void
) {
return
&
_items
[0]; }
48
T
*
newItem
(
void
) {
return
_nextItem
++; }
49
const
T
*
unusedItem
(
void
)
const
{
return
_nextItem
; }
50
51
static
ProfileNodePool
*
createNodePool
(uint32_t a_items);
52
53
uint32_t
memoryUsageChain
(
void
);
54
void
destroy
(
void
);
55
};
56
57
}
// namespace Shiny
58
#endif
// if SHINY_PROFILER == TRUE
59
60
#endif
// ifndef SHINY_*_H
ShinyNode.h
Shiny
Definition:
ShinyData.h:29
Shiny::ProfileNode
Definition:
ShinyNode.h:36
Shiny::ProfileNodePool
Definition:
ShinyNodePool.h:35
Shiny::ProfileNodePool::endOfItems
T * endOfItems
Definition:
ShinyNodePool.h:42
Shiny::ProfileNodePool::nextPool
ProfileNodePool * nextPool
Definition:
ShinyNodePool.h:39
Shiny::ProfileNodePool::_nextItem
T * _nextItem
Definition:
ShinyNodePool.h:41
Shiny::ProfileNodePool::destroy
void destroy(void)
Shiny::ProfileNodePool::firstItem
T * firstItem(void)
Definition:
ShinyNodePool.h:47
Shiny::ProfileNodePool::unusedItem
const T * unusedItem(void) const
Definition:
ShinyNodePool.h:49
Shiny::ProfileNodePool::createNodePool
static ProfileNodePool * createNodePool(uint32_t a_items)
Shiny::ProfileNodePool::memoryUsageChain
uint32_t memoryUsageChain(void)
Shiny::ProfileNodePool::T
ProfileNode T
Definition:
ShinyNodePool.h:37
Shiny::ProfileNodePool::_items
T _items[1]
Definition:
ShinyNodePool.h:44
Shiny::ProfileNodePool::newItem
T * newItem(void)
Definition:
ShinyNodePool.h:48
Generated by
1.9.2