Arcane  v4.1.0.0
Documentation développeur
Chargement...
Recherche...
Aucune correspondance
AllocatedMemoryInfo.h
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2025 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/* Informations sur une zone mémoire allouée. */
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/*---------------------------------------------------------------------------*/
30class AllocatedMemoryInfo
31{
32 public:
33
34 AllocatedMemoryInfo() = default;
35 explicit AllocatedMemoryInfo(void* base_address)
36 : m_base_address(base_address)
37 {}
38 AllocatedMemoryInfo(void* base_address, Int64 size)
39 : m_base_address(base_address)
40 , m_size(size)
41 , m_capacity(size)
42 {}
43 AllocatedMemoryInfo(void* base_address, Int64 size, Int64 capacity)
44 : m_base_address(base_address)
45 , m_size(size)
46 , m_capacity(capacity)
47 {}
48
50 void* baseAddress() const { return m_base_address; }
52 Int64 size() const { return m_size; }
54 Int64 capacity() const { return m_capacity; }
55
56 public:
57
58 void* m_base_address = nullptr;
59 Int64 m_size = -1;
60 Int64 m_capacity = -1;
61};
62
63/*---------------------------------------------------------------------------*/
64/*---------------------------------------------------------------------------*/
65
66} // namespace Arcane
67
68/*---------------------------------------------------------------------------*/
69/*---------------------------------------------------------------------------*/
70
71#endif
72
void * baseAddress() const
Adresse du début de la zone allouée.
Int64 size() const
Taille en octets de la zone mémoire utilisée. (-1) si inconnue.
Int64 capacity() const
Taille en octets de la zone mémoire allouée. (-1) si inconnue.
-*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
std::int64_t Int64
Type entier signé sur 64 bits.