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
qmemory_resource_tlsf_p.h
Go to the documentation of this file.
1
// Copyright (C) 2025 The Qt Company Ltd.
2
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4
#
ifndef
QMEMORY_RESOURCE_TLSF_P_H
5
#
define
QMEMORY_RESOURCE_TLSF_P_H
6
7
//
8
// W A R N I N G
9
// -------------
10
//
11
// This file is not part of the Qt API. It exists purely as an
12
// implementation detail. This header file may change from version to
13
// version without notice, or even be removed.
14
//
15
// We mean it.
16
//
17
18
#
include
<
QtMultimedia
/
private
/
qtmm_pmr_p
.
h
>
19
#
include
<
QtMultimedia
/
qtmultimediaglobal
.
h
>
20
#
include
<
QtCore
/
qtclasshelpermacros
.
h
>
21
22
#
include
<
new
>
23
24
QT_BEGIN_NAMESPACE
25
26
namespace
QtPrivate
{
27
typedef
void
*
tlsf_t
;
28
}
29
30
namespace
QtMultimediaPrivate
{
31
32
struct
QTlsfMemoryResource
final
:
pmr
::
memory_resource
33
{
34
Q_MULTIMEDIA_EXPORT
35
explicit
QTlsfMemoryResource
(
std
::
size_t
preallocatedBytes
,
36
pmr
::
memory_resource
*
upstream
=
pmr
::
get_default_resource
());
37
38
Q_DISABLE_COPY_MOVE
(
QTlsfMemoryResource
)
39
40
Q_MULTIMEDIA_EXPORT
41
~
QTlsfMemoryResource
()
override
;
42
43
private
:
44
void
*
do_allocate
(size_t bytes, size_t alignment)
override
;
45
void
do_deallocate
(
void
*p, size_t bytes, size_t alignment)
override
;
46
bool
do_is_equal
(
const
memory_resource &other)
const
noexcept
override
;
47
48
// cache line alignment on most platforms
49
static
constexpr
auto
poolAlignment =
std
::align_val_t{ 128 };
50
51
QtPrivate
::
tlsf_t
m_tlsf;
52
const
size_t m_allocationSize;
53
std::byte *m_buffer =
nullptr
;
54
pmr::memory_resource *m_upstream{};
55
};
56
57
}
// namespace QtMultimediaPrivate
58
59
QT_END_NAMESPACE
60
61
#
endif
// QMEMORY_RESOURCE_TLSF_P_H
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qsequentialanimationgroup.cpp:47
QtMultimediaPrivate::impl
Definition
qaudiosystem_p.h:257
QtPrivate
Definition
qalloc.h:29
QtPrivate::tlsf_t
void * tlsf_t
Definition
qmemory_resource_tlsf_p.h:27
std
[33]
Definition
src_corelib_tools_qhash.cpp:421
QtMultimediaPrivate::QTlsfMemoryResource::do_deallocate
void do_deallocate(void *p, size_t bytes, size_t alignment) override
Definition
qmemory_resource_tlsf.cpp:43
QtMultimediaPrivate::QTlsfMemoryResource::do_allocate
void * do_allocate(size_t bytes, size_t alignment) override
Definition
qmemory_resource_tlsf.cpp:34
QtMultimediaPrivate::QTlsfMemoryResource::do_is_equal
bool do_is_equal(const memory_resource &other) const noexcept override
Definition
qmemory_resource_tlsf.cpp:51
QtMultimediaPrivate::QTlsfMemoryResource::QTlsfMemoryResource
Q_MULTIMEDIA_EXPORT QTlsfMemoryResource(std::size_t preallocatedBytes, pmr::memory_resource *upstream=pmr::get_default_resource())
Definition
qmemory_resource_tlsf.cpp:14
qtmultimedia
src
multimedia
audio
qmemory_resource_tlsf_p.h
Generated on
for Qt by
1.18.0