Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
Loading...
Searching...
No Matches
glslmemorypool_p.h
Go to the documentation of this file.
1
// Copyright (C) 2021 The Qt Company Ltd.
2
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
// Qt-Security score:significant reason:default
4
5
6
#
ifndef
QSSG_GLSLMEMORYPOOL_H
7
#
define
QSSG_GLSLMEMORYPOOL_H
8
9
//
10
// W A R N I N G
11
// -------------
12
//
13
// This file is not part of the Qt API. It exists purely as an
14
// implementation detail. This header file may change from version to
15
// version without notice, or even be removed.
16
//
17
// We mean it.
18
//
19
20
#
include
<
QtQuick3DGlslParser
/
private
/
glsl_p
.
h
>
21
22
#
include
<
cstddef
>
23
#
include
<
new
>
24
25
QT_BEGIN_NAMESPACE
26
27
namespace
GLSL
{
28
29
class
MemoryPool;
30
31
class
Q_QUICK3DGLSLPARSER_EXPORT
MemoryPool
32
{
33
MemoryPool
(
const
MemoryPool
&
other
);
34
void
operator =(
const
MemoryPool &other);
35
36
public
:
37
MemoryPool
();
38
~
MemoryPool
();
39
40
void
reset
();
41
42
inline
void
*
allocate
(size_t size)
43
{
44
size = (size + 7) & ~7;
45
if
(_ptr && (_ptr + size < _end)) {
46
void
*addr = _ptr;
47
_ptr += size;
48
return
addr;
49
}
50
return
allocate_helper(size);
51
}
52
53
private
:
54
void
*
allocate_helper
(
size_t
size
);
55
56
private
:
57
char
**
_blocks
;
58
int
_allocatedBlocks;
59
int
_blockCount;
60
char
*_ptr;
61
char
*_end;
62
63
enum
64
{
65
BLOCK_SIZE = 8 * 1024,
66
DEFAULT_BLOCK_COUNT = 8
67
};
68
};
69
70
class
Q_QUICK3DGLSLPARSER_EXPORT
Managed
71
{
72
Managed(
const
Managed &other);
73
void
operator
= (
const
Managed &other);
74
75
public
:
76
Managed();
77
virtual
~Managed();
78
79
void
*
operator
new
(size_t size, MemoryPool *pool);
80
void
operator
delete
(
void
*);
81
void
operator
delete
(
void
*, MemoryPool *);
82
};
83
84
}
// namespace GLSL
85
86
QT_END_NAMESPACE
87
88
#
endif
// QSSG_GLSLMEMORYPOOL_H
GLSL::Managed
Definition
glslmemorypool_p.h:71
GLSL::Managed::operator new
void * operator new(size_t size, MemoryPool *pool)
Definition
glslmemorypool.cpp:76
GLSL::Managed::operator delete
void operator delete(void *, MemoryPool *)
Definition
glslmemorypool.cpp:82
GLSL::Managed::operator delete
void operator delete(void *)
Definition
glslmemorypool.cpp:79
GLSL::MemoryPool
Definition
glslmemorypool_p.h:32
GLSL::MemoryPool::reset
void reset()
Definition
glslmemorypool.cpp:35
GLSL::MemoryPool::allocate
void * allocate(size_t size)
Definition
glslmemorypool_p.h:42
GLSL::MemoryPool::~MemoryPool
~MemoryPool()
Definition
glslmemorypool.cpp:23
QQmlSA::Method::operator=
Method & operator=(const Method &)
Assigns other to this Method instance.
Definition
qqmlsa.cpp:612
GLSL
Definition
glslast_p.h:26
assert
#define assert
Definition
qcborcommon_p.h:29
qtquick3d
src
glslparser
glslmemorypool_p.h
Generated on
for Qt by
1.18.0