14#include "arcane/utils/PlatformUtils.h"
15#include "arcane/utils/String.h"
16#include "arcane/utils/StdHeader.h"
17#include "arcane/utils/StackTrace.h"
18#include "arcane/utils/IStackTraceService.h"
19#include "arcane/utils/IOnlineDebuggerService.h"
20#include "arcane/utils/Iostream.h"
21#include "arcane/utils/StringBuilder.h"
22#include "arcane/utils/NotSupportedException.h"
23#include "arcane/utils/Array.h"
24#include "arcane/utils/StringList.h"
25#include "arcane/utils/internal/MemoryRessourceMng.h"
29#ifndef ARCANE_OS_WIN32
45#include <sys/resource.h>
55#if !defined(ARCANE_OS_CYGWIN) && !defined(ARCANE_OS_WIN32)
57#define ARCANE_HAS_I386_FPU_CONTROL_H
58#include <fpu_control.h>
62#ifndef ARCANE_OS_WIN32
73#if defined(ARCANE_OS_LINUX) && defined(__USE_GNU)
75# define ARCANE_GLIBC_FENV
98 bool global_has_color_console =
false;
107 return global_symbolizer_service;
117 global_symbolizer_service = service;
127 return global_online_debugger_service;
137 global_online_debugger_service = service;
147 return global_profiling_service;
157 global_profiling_service = service;
167 return global_dynamic_library_loader;
177 global_dynamic_library_loader =
idll;
187 return global_processor_affinity_service;
197 global_processor_affinity_service = service;
207 return global_performance_counter_service;
216 auto*
old_service = global_performance_counter_service;
217 global_performance_counter_service = service;
227 return global_accelerator_host_memory_allocator;
237 global_accelerator_host_memory_allocator = a;
258 global_data_memory_ressource_mng =
mng;
270 return &global_default_data_memory_ressource_mng;
280 return Arccore::Concurrency::getThreadImplementation();
289 return Arccore::Concurrency::setThreadImplementation(service);
310 cout <<
"** ERROR in setitimer r=" <<
r <<
'\n';
337template<
typename ByteType>
bool
341 long unsigned int file_length = platform::getFileLength(filename);
347 ios::openmode mode = ios::in;
355 out_bytes.resize(file_length);
356 ifile.read((
char*)(out_bytes.data()), file_length);
365 size_t nb_read = ifile.gcount();
366 out_bytes.resize(nb_read);
393static bool global_has_dotnet_runtime =
false;
397 return global_has_dotnet_runtime;
403 global_has_dotnet_runtime = v;
413#if defined(ARCANE_OS_LINUX)
414 char* buf = ::realpath(
"/proc/self/exe",
nullptr);
419#elif defined(ARCANE_OS_WIN32)
426#error "platform::getExeFullPath() not implemented for this platform"
440#if defined(ARCANE_OS_LINUX)
442 std::ifstream
ifile(
"/proc/self/maps");
445 while (
ifile.good()){
448 if (
vb.size()>0 &&
vb[0]==
'/'){
457#elif defined(ARCANE_OS_WIN32)
478#if defined(ARCANE_OS_LINUX)
480 const int BUFSIZE = 1024;
481 char buffer[BUFSIZE + 1];
487 const char* filename =
"/proc/self/cmdline";
493 while ((
nb_read = read(
fd, buffer, BUFSIZE)) > 0) {
494 buffer[BUFSIZE] =
'\0';
500 int size = bytes.size();
501 const char*
ptr = bytes.data();
502 const char* end =
ptr + size;
505 while (*
ptr++ &&
ptr < end)
518 auto x = std::chrono::high_resolution_clock::now();
520 auto y = std::chrono::time_point_cast<std::chrono::nanoseconds>(x);
522 return static_cast<Int64>(y.time_since_epoch().count());
531#if defined(ARCCORE_OS_WIN32)
534 return si.dwPageSize;
535#elif defined(ARCANE_OS_LINUX)
538#warning "getPageSize() not implemented for your platform. Default is 4096"
553 sprintf(filename,
"errlog.%ld", pid);
568#if defined(ARCANE_OS_LINUX)
574 snprintf(cmd,
cmd_size,
"gdb --ex 'set debuginfod enabled off' --ex 'attach %ld' --ex 'info threads' --ex 'thread apply all bt full' --batch", pid);
587#if defined(ARCANE_OS_LINUX)
593 snprintf(cmd,
cmd_size,
"lldb -p %ld -o 'bt' -o 'bt all' -o 'clrthreads' -o 'clrstack' -o 'dumpstack' --batch", pid);
607extern "C" ARCANE_UTILS_EXPORT
void
608_ArcaneSetCallGarbageCollectorDelegate(
void(*f)())
610 global_garbage_collector_delegate = f;
617 (*global_garbage_collector_delegate)();
#define ARCANE_CHECK_POINTER(ptr)
Macro retournant le pointeur ptr s'il est non nul ou lancant une exception s'il est nul.
Tableau d'items de types quelconques.
Interface d'une chargeur dynamique de bibliothèque.
Gestion des ressources mémoire pour les CPU et accélérateurs.
virtual IMemoryAllocator * getAllocator(eMemoryRessource r)=0
Allocateur mémoire pour la ressource r.
Interface d'un service de debugger hybrid.
Interface d'un service de de trace des appels de fonctions.
Interface d'un service de profiling.
Interface d'un service de récupération des symboles du code source.
Lecteur des fichiers de maillage via la bibliothèque LIMA.
Gestion des ressources mémoire pour les CPU et accélérateurs.
Interface d'un allocateur pour la mémoire.
Interface d'un service implémentant le support des threads.
Exception lorsqu'une opération n'est pas supportée.
Vue sur une chaîne de caractères UTF-8.
std::string_view toStdStringView() const ARCCORE_NOEXCEPT
Retourne une vue de la STL de la vue actuelle.
Chaîne de caractères unicode.
-*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
@ UnifiedMemory
Alloue en utilisant la mémoire unifiée.