Arcane  v3.16.6.0
Documentation utilisateur
Tout Classes Espaces de nommage Fichiers Fonctions Variables Définitions de type Énumérations Valeurs énumérées Amis Macros Groupes Pages Concepts
arcane/src/arcane/utils/PlatformUtils.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/* PlatformUtils.cc (C) 2000-2024 */
9/* */
10/* Fonctions utilitaires dépendant de la plateforme. */
11/*---------------------------------------------------------------------------*/
12/*---------------------------------------------------------------------------*/
13
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"
26#include "arcane/utils/internal/MemoryUtilsInternal.h"
27
28#include <chrono>
29
30#ifndef ARCANE_OS_WIN32
31#define ARCANE_OS_UNIX
32#endif
33
34#ifdef ARCANE_OS_WIN32
35#include <sys/types.h>
36#include <sys/timeb.h>
37#include <sys/stat.h>
38#include <direct.h>
39#include <process.h>
40#include <windows.h>
41#include <shlobj.h>
42#endif
43
44#ifdef ARCANE_OS_UNIX
45#include <unistd.h>
46#include <sys/resource.h>
47#include <time.h>
48#include <sys/types.h>
49#include <sys/stat.h>
50#include <sys/time.h>
51#include <fcntl.h>
52#endif
53
54#ifdef ARCANE_OS_MACOS
55#include <cstdlib>
56#include <mach-o/dyld.h>
57#else
58#include <malloc.h>
59#endif
60
61
62#if !defined(ARCANE_OS_CYGWIN) && !defined(ARCANE_OS_WIN32)
63#if defined(__i386__)
64#define ARCANE_HAS_I386_FPU_CONTROL_H
65#include <fpu_control.h>
66#endif
67#endif
68
69#ifndef ARCANE_OS_WIN32
70#include <pwd.h>
71#include <sys/types.h>
72#include <unistd.h>
73#endif
74
75// Support pour gérer les exceptions flottantes:
76// - sous Linux avec la GlibC, cela se fait via les méthodes
77// feenableexcept(), fedisableexcept() et fegetexcept()
78// - sous Win32, cela se fait via la méthode _controlfp() mais pour
79// l'instant ce n'est pas utilisé dans Arcane.
80#if defined(ARCANE_OS_LINUX) && defined(__USE_GNU)
81# include <fenv.h>
82# define ARCANE_GLIBC_FENV
83#endif
84
85/*---------------------------------------------------------------------------*/
86/*---------------------------------------------------------------------------*/
87
88namespace Arcane
89{
90
91/*---------------------------------------------------------------------------*/
92/*---------------------------------------------------------------------------*/
93
94namespace platform
95{
96 IOnlineDebuggerService* global_online_debugger_service = nullptr;
97 ISymbolizerService* global_symbolizer_service = nullptr;
98 IProfilingService* global_profiling_service = nullptr;
99 IProcessorAffinityService* global_processor_affinity_service = nullptr;
100 IDynamicLibraryLoader* global_dynamic_library_loader = nullptr;
101 IPerformanceCounterService* global_performance_counter_service = nullptr;
102 bool global_has_color_console = false;
103}
104
105/*---------------------------------------------------------------------------*/
106/*---------------------------------------------------------------------------*/
107
108extern "C++" ARCANE_UTILS_EXPORT ISymbolizerService* platform::
110{
111 return global_symbolizer_service;
112}
113
114/*---------------------------------------------------------------------------*/
115/*---------------------------------------------------------------------------*/
116
117extern "C++" ARCANE_UTILS_EXPORT ISymbolizerService* platform::
119{
120 ISymbolizerService* old_service = global_symbolizer_service;
121 global_symbolizer_service = service;
122 return old_service;
123}
124
125/*---------------------------------------------------------------------------*/
126/*---------------------------------------------------------------------------*/
127
128extern "C++" ARCANE_UTILS_EXPORT IOnlineDebuggerService* platform::
130{
131 return global_online_debugger_service;
132}
133
134/*---------------------------------------------------------------------------*/
135/*---------------------------------------------------------------------------*/
136
137extern "C++" ARCANE_UTILS_EXPORT IOnlineDebuggerService* platform::
139{
140 IOnlineDebuggerService* old_service = global_online_debugger_service;
141 global_online_debugger_service = service;
142 return old_service;
143}
144
145/*---------------------------------------------------------------------------*/
146/*---------------------------------------------------------------------------*/
147
148extern "C++" ARCANE_UTILS_EXPORT IProfilingService* platform::
150{
151 return global_profiling_service;
152}
153
154/*---------------------------------------------------------------------------*/
155/*---------------------------------------------------------------------------*/
156
157extern "C++" ARCANE_UTILS_EXPORT IProfilingService* platform::
159{
160 IProfilingService* old_service = global_profiling_service;
161 global_profiling_service = service;
162 return old_service;
163}
164
165/*---------------------------------------------------------------------------*/
166/*---------------------------------------------------------------------------*/
167
168extern "C++" ARCANE_UTILS_EXPORT IDynamicLibraryLoader* platform::
170{
171 return global_dynamic_library_loader;
172}
173
174/*---------------------------------------------------------------------------*/
175/*---------------------------------------------------------------------------*/
176
177extern "C++" ARCANE_UTILS_EXPORT IDynamicLibraryLoader* platform::
179{
180 IDynamicLibraryLoader* old_service = global_dynamic_library_loader;
181 global_dynamic_library_loader = idll;
182 return old_service;
183}
184
185/*---------------------------------------------------------------------------*/
186/*---------------------------------------------------------------------------*/
187
188extern "C++" ARCANE_UTILS_EXPORT IProcessorAffinityService* platform::
190{
191 return global_processor_affinity_service;
192}
193
194/*---------------------------------------------------------------------------*/
195/*---------------------------------------------------------------------------*/
196
197extern "C++" ARCANE_UTILS_EXPORT IProcessorAffinityService* platform::
199{
200 IProcessorAffinityService* old_service = global_processor_affinity_service;
201 global_processor_affinity_service = service;
202 return old_service;
203}
204
205/*---------------------------------------------------------------------------*/
206/*---------------------------------------------------------------------------*/
207
208extern "C++" ARCANE_UTILS_EXPORT IPerformanceCounterService* platform::
210{
211 return global_performance_counter_service;
212}
213
214/*---------------------------------------------------------------------------*/
215/*---------------------------------------------------------------------------*/
216
217extern "C++" ARCANE_UTILS_EXPORT IPerformanceCounterService* platform::
219{
220 auto* old_service = global_performance_counter_service;
221 global_performance_counter_service = service;
222 return old_service;
223}
224
225/*---------------------------------------------------------------------------*/
226/*---------------------------------------------------------------------------*/
227
233
234/*---------------------------------------------------------------------------*/
235/*---------------------------------------------------------------------------*/
236
237extern "C++" ARCANE_UTILS_EXPORT IMemoryAllocator* platform::
239{
240 return MemoryUtils::setAcceleratorHostMemoryAllocator(a);
241}
242
243/*---------------------------------------------------------------------------*/
244/*---------------------------------------------------------------------------*/
245
251
252/*---------------------------------------------------------------------------*/
253/*---------------------------------------------------------------------------*/
254
255extern "C++" ARCANE_UTILS_EXPORT IMemoryRessourceMng* platform::
256setDataMemoryRessourceMng(IMemoryRessourceMng* mng)
257{
258 return MemoryUtils::setDataMemoryResourceMng(mng);
259}
260
261/*---------------------------------------------------------------------------*/
262/*---------------------------------------------------------------------------*/
263
264IMemoryRessourceMng* platform::
266{
267 return MemoryUtils::getDataMemoryResourceMng();
268}
269
270/*---------------------------------------------------------------------------*/
271/*---------------------------------------------------------------------------*/
272
273extern "C++" ARCANE_UTILS_EXPORT IThreadImplementation* platform::
275{
276 return Arccore::Concurrency::getThreadImplementation();
277}
278
279/*---------------------------------------------------------------------------*/
280/*---------------------------------------------------------------------------*/
281
282extern "C++" ARCANE_UTILS_EXPORT IThreadImplementation* platform::
284{
285 return Arccore::Concurrency::setThreadImplementation(service);
286}
287
288/*---------------------------------------------------------------------------*/
289/*---------------------------------------------------------------------------*/
290
291extern "C++" ARCANE_UTILS_EXPORT void platform::
292resetAlarmTimer(Integer nb_second)
293{
294#ifdef ARCANE_OS_UNIX
295 struct itimerval time_val;
296 struct itimerval otime_val;
297 time_val.it_value.tv_sec = nb_second;
298 time_val.it_value.tv_usec = 0;
299 time_val.it_interval.tv_sec = 0;
300 time_val.it_interval.tv_usec = 0;
301 // Utilise le temps virtuel et pas le temps réel.
302 // Cela permet de suspendre temporairement un job (par exemple
303 // pour régler des problèmes systèmes) sans déclencher l'alarme.
304 int r = setitimer(ITIMER_VIRTUAL,&time_val,&otime_val);
305 if (r!=0)
306 cout << "** ERROR in setitimer r=" << r << '\n';
307#endif
308}
309
310/*---------------------------------------------------------------------------*/
311/*---------------------------------------------------------------------------*/
312
313extern "C++" ARCANE_UTILS_EXPORT void platform::
315{
317}
318
319/*---------------------------------------------------------------------------*/
320/*---------------------------------------------------------------------------*/
321
322extern "C++" ARCANE_UTILS_EXPORT void platform::
324{
326}
327
328/*---------------------------------------------------------------------------*/
329/*---------------------------------------------------------------------------*/
330
331namespace
332{
333template<typename ByteType> bool
334_readAllFile(StringView filename, bool is_binary, Array<ByteType>& out_bytes)
335{
336 using namespace std;
337 long unsigned int file_length = platform::getFileLength(filename);
338 if (file_length == 0) {
339 //cerr << "** FAIL LENGTH\n";
340 return true;
341 }
342 ifstream ifile;
343 ios::openmode mode = ios::in;
344 if (is_binary)
345 mode |= ios::binary;
346 ifile.open(filename.toStdStringView().data());
347 if (ifile.fail()) {
348 //cerr << "** FAIL OPEN\n";
349 return true;
350 }
351 out_bytes.resize(file_length);
352 ifile.read((char*)(out_bytes.data()), file_length);
353 if (ifile.bad()) {
354 // cerr << "** BAD READ\n";
355 return true;
356 }
357 // Il est possible que le nombre d'octets lus soit inférieur
358 // à la longueur du fichier, notamment sous Windows avec les fichiers
359 // texte et la conversion des retour-chariots. Il faut donc redimensionner
360 // \a bytes à la bonne longueur.
361 size_t nb_read = ifile.gcount();
362 out_bytes.resize(nb_read);
363 //cerr << "** READ " << file_length << " bytes " << (const char*)(bytes.begin()) << "\n";
364 return false;
365}
366}
367
368/*---------------------------------------------------------------------------*/
369/*---------------------------------------------------------------------------*/
370
372readAllFile(StringView filename, bool is_binary, ByteArray& out_bytes)
373{
374 return _readAllFile(filename,is_binary,out_bytes);
375}
376
377/*---------------------------------------------------------------------------*/
378/*---------------------------------------------------------------------------*/
379
381readAllFile(StringView filename, bool is_binary, Array<std::byte>& out_bytes)
382{
383 return _readAllFile(filename,is_binary,out_bytes);
384}
385
386/*---------------------------------------------------------------------------*/
387/*---------------------------------------------------------------------------*/
388
389static bool global_has_dotnet_runtime = false;
390extern "C++" bool platform::
392{
393 return global_has_dotnet_runtime;
394}
395
396extern "C++" void platform::
398{
399 global_has_dotnet_runtime = v;
400}
401
402/*---------------------------------------------------------------------------*/
403/*---------------------------------------------------------------------------*/
404
405extern "C++" String platform::
407{
408 String full_path;
409#if defined(ARCANE_OS_LINUX)
410 char* buf = ::realpath("/proc/self/exe",nullptr);
411 if (buf){
412 full_path = StringView(buf);
413 ::free(buf);
414 }
415#elif defined(ARCANE_OS_WIN32)
416 char buf[2048];
417 int r = GetModuleFileNameA(NULL,buf,2000);
418 if (r>0){
419 full_path = StringView(buf);
420 }
421#elif defined(ARCANE_OS_MACOS)
422 char buf[2048];
423 uint32_t bufSize = 2000;
424 int r = _NSGetExecutablePath(buf, &bufSize);
425 if (r==0) { // success returns 0
426 full_path = StringView(buf);
427 }
428#else
429#error "platform::getExeFullPath() not implemented for this platform"
430#endif
431 return full_path;
432}
433
434/*---------------------------------------------------------------------------*/
435/*---------------------------------------------------------------------------*/
436
437extern "C++" String platform::
439{
440 String full_path;
441 if (dll_name.null())
442 return full_path;
443#if defined(ARCANE_OS_LINUX)
444 {
445 std::ifstream ifile("/proc/self/maps");
446 String v;
447 String true_name = "lib" + dll_name + ".so";
448 while (ifile.good()){
449 ifile >> v;
450 Span<const Byte> vb = v.bytes();
451 if (vb.size()>0 && vb[0]=='/'){
452 if (v.endsWith(true_name)){
453 full_path = v;
454 //std::cout << "V='" << v << "'\n";
455 break;
456 }
457 }
458 }
459 }
460#elif defined(ARCANE_OS_WIN32)
461 HMODULE hModule = GetModuleHandleA(dll_name.localstr());
462 if (!hModule)
463 return full_path;
464 TCHAR dllPath[_MAX_PATH];
465 GetModuleFileName(hModule, dllPath, _MAX_PATH);
466 full_path = StringView(dllPath);
467#elif defined(ARCANE_OS_MACOS)
468 {
469 String true_name = "lib" + dll_name + ".dylib";
470 uint32_t count = _dyld_image_count();
471 for (uint32_t i = 0; i < count; i++) {
472 const char* image_name = _dyld_get_image_name(i);
473 if (image_name) {
474 String image_path(image_name);
475 if (image_path.endsWith(true_name)) {
476 full_path = image_path;
477 break;
478 }
479 }
480 }
481 }
482#else
483 throw NotSupportedException(A_FUNCINFO);
484//#error "platform::getSymbolFullPath() not implemented for this platform"
485#endif
486 return full_path;
487}
488
489/*---------------------------------------------------------------------------*/
490/*---------------------------------------------------------------------------*/
491
492extern "C++" void platform::
494{
495 arg_list.clear();
496#if defined(ARCANE_OS_LINUX)
497
498 const int BUFSIZE = 1024;
499 char buffer[BUFSIZE + 1];
500
501 UniqueArray<char> bytes;
502 bytes.reserve(1024);
503
504 {
505 const char* filename = "/proc/self/cmdline";
506 int fd = open(filename, O_RDONLY);
507 if (fd<0)
508 return;
509 ssize_t nb_read = 0;
510 // TODO: traiter les interruptions
511 while ((nb_read = read(fd, buffer, BUFSIZE)) > 0) {
512 buffer[BUFSIZE] = '\0';
513 bytes.addRange(Span<const char>(buffer, nb_read));
514 }
515 close(fd);
516 }
517
518 int size = bytes.size();
519 const char* ptr = bytes.data();
520 const char* end = ptr + size;
521 while (ptr < end) {
522 arg_list.add(StringView(ptr));
523 while (*ptr++ && ptr < end)
524 ;
525 }
526#endif
527}
528
529/*---------------------------------------------------------------------------*/
530/*---------------------------------------------------------------------------*/
531// TODO: mettre ensuite dans 'Arccore'
532
533extern "C++" ARCANE_UTILS_EXPORT Int64 platform::
535{
536 auto x = std::chrono::high_resolution_clock::now();
537 // Converti la valeur en nanosecondes.
538 auto y = std::chrono::time_point_cast<std::chrono::nanoseconds>(x);
539 // Retourne le temps en nano-secondes.
540 return static_cast<Int64>(y.time_since_epoch().count());
541}
542
543/*---------------------------------------------------------------------------*/
544/*---------------------------------------------------------------------------*/
545
546extern "C++" ARCANE_UTILS_EXPORT Int64 platform::
548{
549#if defined(ARCCORE_OS_WIN32)
550 SYSTEM_INFO si;
551 GetSystemInfo(&si);
552 return si.dwPageSize;
553#elif defined(ARCANE_OS_LINUX)
554 return ::sysconf(_SC_PAGESIZE);
555#else
556#warning "getPageSize() not implemented for your platform. Default is 4096"
557 Int64 page_size = 4096;
558 return page_size;
559#endif
560}
561
562/*---------------------------------------------------------------------------*/
563/*---------------------------------------------------------------------------*/
564
565namespace
566{
567 String _getDebuggerStack(const char* command)
568 {
569 char filename[4096];
570 long pid = (long)getpid();
571 sprintf(filename, "errlog.%ld", pid);
572 int ret_value = system(command);
573 if (ret_value != 0) {
574 UniqueArray<Byte> bytes;
575 if (!platform::readAllFile(filename, false, bytes))
576 return String(bytes);
577 }
578 return {};
579 }
580} // namespace
581
582extern "C++" ARCANE_UTILS_EXPORT String platform::
584{
585 String result;
586#if defined(ARCANE_OS_LINUX)
587 const size_t cmd_size = 4096;
588 char cmd[cmd_size + 1];
589 //sprintf (cmd, "gdb --ex 'attach %ld' --ex 'info threads' --ex 'thread apply all bt'", (long)getpid ());
590 //sprintf (cmd, "gdb --ex 'attach %ld' --ex 'info threads' --ex 'thread apply all bt' --batch", (long)getpid ());
591 long pid = (long)getpid();
592 snprintf(cmd, cmd_size, "gdb --ex 'set debuginfod enabled off' --ex 'attach %ld' --ex 'info threads' --ex 'thread apply all bt full' --batch", pid);
593 result = _getDebuggerStack(cmd);
594#endif
595 return result;
596}
597
598/*---------------------------------------------------------------------------*/
599/*---------------------------------------------------------------------------*/
600
601extern "C++" ARCANE_UTILS_EXPORT String platform::
603{
604 String result;
605#if defined(ARCANE_OS_LINUX)
606 const size_t cmd_size = 4096;
607 char cmd[cmd_size + 1];
608 long pid = (long)getpid();
609 // Les commandes 'clrthreads', 'clrstack' et 'dumpstack' nécessitent
610 // d'avoir installé 'dotnet-sos'.
611 snprintf(cmd, cmd_size, "lldb -p %ld -o 'bt' -o 'bt all' -o 'clrthreads' -o 'clrstack' -o 'dumpstack' --batch", pid);
612 result = _getDebuggerStack(cmd);
613#endif
614 return result;
615}
616
617/*---------------------------------------------------------------------------*/
618/*---------------------------------------------------------------------------*/
619
620namespace
621{
622void (*global_garbage_collector_delegate)() = nullptr;
623}
624
625extern "C" ARCANE_UTILS_EXPORT void
626_ArcaneSetCallGarbageCollectorDelegate(void(*f)())
627{
628 global_garbage_collector_delegate = f;
629}
630
631extern "C++" void platform::
633{
634 if (global_garbage_collector_delegate)
635 (*global_garbage_collector_delegate)();
636}
637
638/*---------------------------------------------------------------------------*/
639/*---------------------------------------------------------------------------*/
640
641} // End namespace Arcane
642
643/*---------------------------------------------------------------------------*/
644/*---------------------------------------------------------------------------*/
Fonctions de gestion mémoire et des allocateurs.
Integer size() const
Nombre d'éléments du vecteur.
Classe de base des vecteurs 1D de données.
void addRange(ConstReferenceType val, Int64 n)
Ajoute n élément de valeur val à la fin du tableau.
void resize(Int64 s)
Change le nombre d'éléments du tableau à s.
const T * data() const
Accès à la racine du tableau hors toute protection.
void reserve(Int64 new_capacity)
Réserve le mémoire pour new_capacity éléments.
void clear()
Supprime tous les éléments de la collection.
Definition Collection.h:68
Interface d'un service d'accès aux compteurs de performance.
Interface d'un service de récupération des symboles du code source.
Interface d'un service implémentant le support des threads.
constexpr __host__ __device__ SizeType size() const noexcept
Retourne la taille du tableau.
Definition Span.h:212
Vue d'un tableau d'éléments de type T.
Definition Span.h:513
Vue sur une chaîne de caractères UTF-8.
Definition StringView.h:47
std::string_view toStdStringView() const ARCCORE_NOEXCEPT
Retourne une vue de la STL de la vue actuelle.
Definition StringView.h:112
Chaîne de caractères unicode.
bool null() const
Retourne true si la chaîne est nulle.
Definition String.cc:304
const char * localstr() const
Retourne la conversion de l'instance dans l'encodage UTF-8.
Definition String.cc:227
bool endsWith(const String &s) const
Indique si la chaîne se termine par les caractères de s.
Definition String.cc:1083
Vecteur 1D de données avec sémantique par valeur (style STL).
IMemoryAllocator * getDefaultDataAllocator()
Allocateur par défaut pour les données.
IMemoryAllocator * getAcceleratorHostMemoryAllocator()
Allocateur spécifique pour les accélérateurs.
ARCCORE_BASE_EXPORT void platformTerminate()
Routines de fin de programme spécifiques à une platforme.
ARCCORE_BASE_EXPORT void platformInitialize()
Initialisations spécifiques à une platforme.
Espace de nom pour les fonctions dépendant de la plateforme.
IPerformanceCounterService * setPerformanceCounterService(IPerformanceCounterService *service)
Positionne le service utilisé pour gérer les compteurs interne du processeur.
void callDotNETGarbageCollector()
Appelle le Garbage Collector de '.Net' s'il est disponible.
String getLLDBStack()
Récupère la pile d'appel via lldb.
String getLoadedSharedLibraryFullPath(const String &dll_name)
Retourne le chemin complet d'une bibliothèque dynamique chargée.
ISymbolizerService * setSymbolizerService(ISymbolizerService *service)
Positionne le service pour obtenir des informations sur les symboles du code source.
IDynamicLibraryLoader * getDynamicLibraryLoader()
Service utilisé pour charger dynamiquement des bibliothèques.
void fillCommandLineArguments(StringList &arg_list)
Remplit arg_list avec les arguments de la ligne de commande.
IMemoryRessourceMng * setDataMemoryRessourceMng(IMemoryRessourceMng *mng)
Positionne le gestionnaire de ressource mémoire pour les données.
void platformInitialize()
Initialisations spécifiques à une platforme.
IOnlineDebuggerService * setOnlineDebuggerService(IOnlineDebuggerService *service)
Positionne le service a utiliser pour l'architecture en ligne de debug.
ISymbolizerService * getSymbolizerService()
Service utilisé pour obtenir des informations sur les symboles du code source.
IProfilingService * getProfilingService()
Service utilisé pour obtenir pour obtenir des informations de profiling.
IMemoryRessourceMng * getDataMemoryRessourceMng()
Gestionnaire de ressource mémoire pour les données.
void resetAlarmTimer(Integer nb_second)
Remet à timer d'alarme à nb_second.
void platformTerminate()
Routines de fin de programme spécifiques à une platforme.
ARCCORE_BASE_EXPORT long unsigned int getFileLength(const String &filename)
Longueur du fichier filename. Si le fichier n'est pas lisible ou n'existe pas, retourne 0.
IProfilingService * setProfilingService(IProfilingService *service)
Positionne le service utilisé pour obtenir des informations de profiling.
IMemoryAllocator * getAcceleratorHostMemoryAllocator()
Allocateur spécifique pour les accélérateurs.
IMemoryAllocator * getDefaultDataAllocator()
Allocateur par défaut pour les données.
Int64 getPageSize()
Taille des pages du système hôte en octets.
String getExeFullPath()
Retourne le nom complet avec le chemin de l'exécutable.
Int64 getRealTimeNS()
Temps horloge en nano-secondes.
bool readAllFile(StringView filename, bool is_binary, ByteArray &out_bytes)
Lit le contenu d'un fichier et le conserve dans out_bytes.
IProcessorAffinityService * setProcessorAffinityService(IProcessorAffinityService *service)
Positionne le service utilisé pour la gestion de l'affinité des processeurs.
void setHasDotNETRuntime(bool v)
Positionne si le code s'exécute avec le runtime .NET.
IProcessorAffinityService * getProcessorAffinityService()
Service utilisé pour la gestion de l'affinité des processeurs.
IMemoryAllocator * setAcceleratorHostMemoryAllocator(IMemoryAllocator *a)
Positionne l'allocateur spécifique pour les accélérateurs.
IThreadImplementation * getThreadImplementationService()
Service utilisé pour gérer les threads.
IDynamicLibraryLoader * setDynamicLibraryLoader(IDynamicLibraryLoader *idll)
Positionne le service utilisé pour charger dynamiquement des bibliothèques.
IPerformanceCounterService * getPerformanceCounterService()
Service utilisé pour obtenir pour obtenir les compteurs interne du processeur.
bool hasDotNETRuntime()
Vrai si le code s'exécute avec le runtime .NET.
String getGDBStack()
Récupère la pile d'appel via gdb.
IThreadImplementation * setThreadImplementationService(IThreadImplementation *service)
Positionne le service utilisé pour gérer les threads.
IOnlineDebuggerService * getOnlineDebuggerService()
Service utilisé pour obtenir la mise en place d'une architecture en ligne de debug.
-*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
std::int64_t Int64
Type entier signé sur 64 bits.
Int32 Integer
Type représentant un entier.
Array< Byte > ByteArray
Tableau dynamique à une dimension de caractères.
Definition UtilsTypes.h:208
List< String > StringList
Tableau de chaînes de caractères unicode.
Definition UtilsTypes.h:596