Arcane  v4.1.1.0
Documentation utilisateur
Chargement...
Recherche...
Aucune correspondance
arcane/src/arcane/utils/MemoryUtils.cc
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/* MemoryUtils.cc (C) 2000-2025 */
9/* */
10/* Fonctions utilitaires de gestion mémoire. */
11/*---------------------------------------------------------------------------*/
12/*---------------------------------------------------------------------------*/
13
15
16#include "arcane/utils/FatalErrorException.h"
17#include "arcane/utils/MemoryAllocator.h"
18#include "arcane/utils/IMemoryRessourceMng.h"
19#include "arcane/utils/String.h"
20#include "arccore/common/internal/IMemoryResourceMngInternal.h"
21
22/*---------------------------------------------------------------------------*/
23/*---------------------------------------------------------------------------*/
24/*!
25 * \file MemoryUtils.h
26 * \brief Fonctions de gestion mémoire et des allocateurs.
27 */
28/*!
29 * \namespace Arcane::MemoryUtils
30 * \brief Espace de noms pour les fonctions de gestion mémoire et des allocateurs.
31 */
32/*---------------------------------------------------------------------------*/
33/*---------------------------------------------------------------------------*/
34
35namespace Arcane
36{
37
38/*---------------------------------------------------------------------------*/
39/*---------------------------------------------------------------------------*/
40
41Int64 MemoryUtils::impl::
42computeCapacity(Int64 size)
43{
44 double d_size = static_cast<double>(size);
45 double d_new_capacity = d_size * 1.8;
46 if (size > 5000000)
47 d_new_capacity = d_size * 1.2;
48 else if (size > 500000)
49 d_new_capacity = d_size * 1.5;
50 return static_cast<Int64>(d_new_capacity);
51}
52
53/*---------------------------------------------------------------------------*/
54/*---------------------------------------------------------------------------*/
55
56} // End namespace Arcane
57
58/*---------------------------------------------------------------------------*/
59/*---------------------------------------------------------------------------*/
Fonctions de gestion mémoire et des allocateurs.
-*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
std::int64_t Int64
Type entier signé sur 64 bits.