Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
AllocatedMemoryInfo.h
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2026 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
4// See the top-level COPYRIGHT file for details.
5// SPDX-License-Identifier: Apache-2.0
6//-----------------------------------------------------------------------------
7/*---------------------------------------------------------------------------*/
8/* AllocatedMemoryInfo.h (C) 2000-2025 */
9/* */
10/* Information about an allocated memory region. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCCORE_COMMON_ALLOCATEDMEMORYINFO_H
13#define ARCCORE_COMMON_ALLOCATEDMEMORYINFO_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#include "arccore/common/CommonGlobal.h"
18
19/*---------------------------------------------------------------------------*/
20/*---------------------------------------------------------------------------*/
21
22namespace Arcane
23{
24
25/*---------------------------------------------------------------------------*/
26/*---------------------------------------------------------------------------*/
27
31class AllocatedMemoryInfo
32{
33 public:
34
35 AllocatedMemoryInfo() = default;
36 explicit AllocatedMemoryInfo(void* base_address)
37 : m_base_address(base_address)
38 {}
39 AllocatedMemoryInfo(void* base_address, Int64 size)
40 : m_base_address(base_address)
41 , m_size(size)
42 , m_capacity(size)
43 {}
44 AllocatedMemoryInfo(void* base_address, Int64 size, Int64 capacity)
45 : m_base_address(base_address)
46 , m_size(size)
47 , m_capacity(capacity)
48 {}
49
51 void* baseAddress() const { return m_base_address; }
53 Int64 size() const { return m_size; }
55 Int64 capacity() const { return m_capacity; }
56
57 public:
58
59 void* m_base_address = nullptr;
60 Int64 m_size = -1;
61 Int64 m_capacity = -1;
62};
63
64/*---------------------------------------------------------------------------*/
65/*---------------------------------------------------------------------------*/
66
67} // namespace Arcane
68
69/*---------------------------------------------------------------------------*/
70/*---------------------------------------------------------------------------*/
71
72#endif
void * baseAddress() const
Address of the start of the allocated region.
Int64 size() const
Size in bytes of the used memory region. (-1) if unknown.
Int64 capacity() const
Size in bytes of the allocated memory region. (-1) if unknown.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
std::int64_t Int64
Signed integer type of 64 bits.