Arcane  4.1.12.0
User documentation
Loading...
Searching...
No Matches
IMemoryPool.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/* IMemoryPool.h (C) 2000-2026 */
9/* */
10/* Interface of a memory pool. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCCORE_COMMON_IMEMORYPOOL_H
13#define ARCCORE_COMMON_IMEMORYPOOL_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#include "arccore/common/CommonGlobal.h"
18
19/*---------------------------------------------------------------------------*/
20/*---------------------------------------------------------------------------*/
21
22namespace Arcane
23{
24
25/*---------------------------------------------------------------------------*/
26/*---------------------------------------------------------------------------*/
27
28/*!
29 * \brief Interface of a memory pool.
30 */
31class ARCCORE_COMMON_EXPORT IMemoryPool
32{
33 public:
34
35 virtual ~IMemoryPool() = default;
36
37 public:
38
39 /*!
40 * \brief Sets the byte size from which a block is not kept in the cache.
41 *
42 * This method can only be called if there are no blocks in the cache.
43 */
44 virtual void setMaxCachedBlockSize(Int32 v) = 0;
45
46 //! Frees the memory in the cache
47 virtual void freeCachedMemory() = 0;
48
49 //! Total size (in bytes) allocated in the memory pool
50 virtual Int64 totalAllocated() const = 0;
51
52 //! Total size (in bytes) in the cache
53 virtual Int64 totalCached() const = 0;
54};
55
56/*---------------------------------------------------------------------------*/
57/*---------------------------------------------------------------------------*/
58
59} // namespace Arcane
60
61/*---------------------------------------------------------------------------*/
62/*---------------------------------------------------------------------------*/
63
64#endif
Interface of a memory pool.
Definition IMemoryPool.h:32
virtual void setMaxCachedBlockSize(Int32 v)=0
Sets the byte size from which a block is not kept in the cache.
virtual Int64 totalAllocated() const =0
Total size (in bytes) allocated in the memory pool.
virtual Int64 totalCached() const =0
Total size (in bytes) in the cache.
virtual void freeCachedMemory()=0
Frees the memory in the cache.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
std::int64_t Int64
Signed integer type of 64 bits.
std::int32_t Int32
Signed integer type of 32 bits.