# French translation of manpages # This file is distributed under the same license as the manpages-l10n package. # Copyright © of this file: # Christophe Blaess , 1996-2003. # Stéphan Rafin , 2002. # Thierry Vignaud , 1999,2002. # François Micaux, 2002. # Alain Portal , 2003-2008. # Jean-Philippe Guérard , 2005-2006. # Jean-Luc Coulon (f5ibh) , 2006-2007. # Julien Cristau , 2006-2007. # Thomas Huriaux , 2006-2008. # Nicolas François , 2006-2008. # Florentin Duneau , 2006-2010. # Simon Paillard , 2006, 2012-2014. # Denis Barbier , 2006,2010. # David Prévot , 2010-2014. # Grégoire Scano , 2020-2021. msgid "" msgstr "" "Project-Id-Version: manpages-l10n 4.22.0\n" "POT-Creation-Date: 2024-06-01 06:01+0200\n" "PO-Revision-Date: 2024-05-07 17:35+0200\n" "Last-Translator: Grégoire Scano \n" "Language-Team: French \n" "Language: fr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n > 1;\n" "X-Generator: Lokalize 22.12.3\n" #. type: TH #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "malloc_info" msgstr "malloc_info" #. type: TH #: archlinux debian-unstable opensuse-tumbleweed #, no-wrap msgid "2024-05-02" msgstr "2 mai 2024" #. type: TH #: archlinux debian-unstable #, no-wrap msgid "Linux man-pages 6.8" msgstr "Pages du manuel de Linux 6.8" #. type: SH #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "NAME" msgstr "NOM" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "malloc_info - export malloc state to a stream" msgstr "malloc_info - Exporter l'état de malloc vers un flux" #. type: SH #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "LIBRARY" msgstr "BIBLIOTHÈQUE" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "Standard C library (I, I<-lc>)" msgstr "Bibliothèque C standard (I, I<-lc>)" #. type: SH #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "SYNOPSIS" msgstr "SYNOPSIS" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "B<#include Emalloc.hE>\n" msgstr "B<#include Emalloc.hE>\n" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "BIB<, FILE *>IB<);>\n" msgstr "BIB<, FILE *>IB<);>\n" #. type: SH #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "DESCRIPTION" msgstr "DESCRIPTION" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "The B() function exports an XML string that describes the " "current state of the memory-allocation implementation in the caller. The " "string is printed on the file stream I. The exported string " "includes information about all arenas (see B(3))." msgstr "" "La fonction B() exporte une chaîne XML décrivant l'état actuel " "de l'allocation mémoire pour l'appelant. Cette chaîne est écrite dans le " "flux I. La chaîne exportée contient des informations concernant " "toutes les domaines de mémoires (« arenas », consultez B(3))." #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "As currently implemented, I must be zero." msgstr "Dans la mise en œuvre actuelle, le paramètre I doit être nul." #. type: SH #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "RETURN VALUE" msgstr "VALEUR RENVOYÉE" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "On success, B() returns 0. On failure, it returns -1, and " "I is set to indicate the error." msgstr "" "En cas de succès, B() renvoie B<0>. En cas d'erreur, B<-1> est " "renvoyé et I contient le code d'erreur." #. type: SH #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "ERRORS" msgstr "ERREURS" #. type: TP #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "B" msgstr "B" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "I was nonzero." msgstr "Le paramètre I n'était pas nul." #. type: SH #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "ATTRIBUTES" msgstr "ATTRIBUTS" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "For an explanation of the terms used in this section, see B(7)." msgstr "" "Pour une explication des termes utilisés dans cette section, consulter " "B(7)." #. type: tbl table #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "Interface" msgstr "Interface" #. type: tbl table #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "Attribute" msgstr "Attribut" #. type: tbl table #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "Value" msgstr "Valeur" #. type: tbl table #: archlinux debian-unstable fedora-40 fedora-rawhide mageia-cauldron #: opensuse-tumbleweed #, no-wrap msgid ".na\n" msgstr ".na\n" #. type: tbl table #: archlinux debian-unstable fedora-40 fedora-rawhide mageia-cauldron #: opensuse-tumbleweed #, no-wrap msgid ".nh\n" msgstr ".nh\n" #. type: tbl table #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "B()" msgstr "B()" #. type: tbl table #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "Thread safety" msgstr "Sécurité des threads" #. type: tbl table #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "MT-Safe" msgstr "MT-Safe" #. type: SH #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "STANDARDS" msgstr "STANDARDS" #. type: Plain text #: archlinux debian-unstable fedora-40 fedora-rawhide mageia-cauldron #: opensuse-leap-15-6 opensuse-tumbleweed msgid "GNU." msgstr "GNU." #. type: SH #: archlinux debian-unstable fedora-40 fedora-rawhide mageia-cauldron #: opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "HISTORY" msgstr "HISTORIQUE" #. type: Plain text #: archlinux debian-unstable fedora-40 fedora-rawhide mageia-cauldron #: opensuse-leap-15-6 opensuse-tumbleweed msgid "glibc 2.10." msgstr "glibc 2.10." #. type: SH #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "NOTES" msgstr "NOTES" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "The memory-allocation information is provided as an XML string (rather than " "a C structure) because the information may change over time (according to " "changes in the underlying implementation). The output XML string includes a " "version field." msgstr "" "L'information d'allocation mémoire est fournie sous forme de flux XML " "(plutôt que de structure C), car les informations fournies pourront évoluer " "dans le futur, en raison de modifications dans le code mis en œuvre. La " "sortie XML comporte un champ de version." #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "The B(3) function can be used to send the output of " "B() directly into a buffer in memory, rather than to a file." msgstr "" "La fonction B(3) peut être utilisée pour envoyer la sortie " "de B() directement dans un tampon en mémoire plutôt que dans un " "fichier." #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "The B() function is designed to address deficiencies in " "B(3) and B(3)." msgstr "" "La fonction B() est conçue pour combler les manques de " "B(3) et B(3)." #. type: SH #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "EXAMPLES" msgstr "EXEMPLES" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "The program below takes up to four command-line arguments, of which the " "first three are mandatory. The first argument specifies the number of " "threads that the program should create. All of the threads, including the " "main thread, allocate the number of blocks of memory specified by the second " "argument. The third argument controls the size of the blocks to be " "allocated. The main thread creates blocks of this size, the second thread " "created by the program allocates blocks of twice this size, the third thread " "allocates blocks of three times this size, and so on." msgstr "" "Le programme ci-dessous accepte jusqu'à quatre paramètres en ligne de " "commande dont les trois premiers sont obligatoires. Le premier paramètre " "indique le nombre de processus légers (« threads ») que le programme doit " "créer. Tous les threads, thread principal compris, allouent le nombre de " "blocs de mémoire indiqué en deuxième paramètre. Le troisième paramètre " "contrôle la taille des blocs à allouer. Le thread principal crée des blocs " "de cette taille, le deuxième thread créé par le programme alloue des blocs " "deux fois plus grands, le troisième thread alloue des blocs trois fois plus " "grands et ainsi de suite." #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "The program calls B() twice to display the memory-allocation " "state. The first call takes place before any threads are created or memory " "allocated. The second call is performed after all threads have allocated " "memory." msgstr "" "Le programme appelle B() deux fois pour afficher l'état de " "l'allocation mémoire. Le premier appel est effectué avant la création d’un " "thread ou l'allocation de mémoire. Le deuxième appel est effectué une fois " "que tous les threads ont alloué de la mémoire." #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "In the following example, the command-line arguments specify the creation of " "one additional thread, and both the main thread and the additional thread " "allocate 10000 blocks of memory. After the blocks of memory have been " "allocated, B() shows the state of two allocation arenas." msgstr "" "Dans l'exemple suivant, les paramètres commandent la création d'un thread " "additionnel, allouant 10 000 blocs de mémoire, comme le thread principal. " "Une fois les blocs de mémoire alloués, B() affiche l'état des " "deux domaines de mémoire." #. type: Plain text #: archlinux debian-unstable fedora-40 fedora-rawhide mageia-cauldron #: opensuse-tumbleweed #, no-wrap msgid "" "$ B\n" "glibc 2.13\n" "$ B<./a.out 1 10000 100>\n" "============ Before allocating blocks ============\n" "Emalloc version=\"1\"E\n" "Eheap nr=\"0\"E\n" "EsizesE\n" "E/sizesE\n" "Etotal type=\"fast\" count=\"0\" size=\"0\"/E\n" "Etotal type=\"rest\" count=\"0\" size=\"0\"/E\n" "Esystem type=\"current\" size=\"135168\"/E\n" "Esystem type=\"max\" size=\"135168\"/E\n" "Easpace type=\"total\" size=\"135168\"/E\n" "Easpace type=\"mprotect\" size=\"135168\"/E\n" "E/heapE\n" "Etotal type=\"fast\" count=\"0\" size=\"0\"/E\n" "Etotal type=\"rest\" count=\"0\" size=\"0\"/E\n" "Esystem type=\"current\" size=\"135168\"/E\n" "Esystem type=\"max\" size=\"135168\"/E\n" "Easpace type=\"total\" size=\"135168\"/E\n" "Easpace type=\"mprotect\" size=\"135168\"/E\n" "E/mallocE\n" "\\&\n" "============ After allocating blocks ============\n" "Emalloc version=\"1\"E\n" "Eheap nr=\"0\"E\n" "EsizesE\n" "E/sizesE\n" "Etotal type=\"fast\" count=\"0\" size=\"0\"/E\n" "Etotal type=\"rest\" count=\"0\" size=\"0\"/E\n" "Esystem type=\"current\" size=\"1081344\"/E\n" "Esystem type=\"max\" size=\"1081344\"/E\n" "Easpace type=\"total\" size=\"1081344\"/E\n" "Easpace type=\"mprotect\" size=\"1081344\"/E\n" "E/heapE\n" "Eheap nr=\"1\"E\n" "EsizesE\n" "E/sizesE\n" "Etotal type=\"fast\" count=\"0\" size=\"0\"/E\n" "Etotal type=\"rest\" count=\"0\" size=\"0\"/E\n" "Esystem type=\"current\" size=\"1032192\"/E\n" "Esystem type=\"max\" size=\"1032192\"/E\n" "Easpace type=\"total\" size=\"1032192\"/E\n" "Easpace type=\"mprotect\" size=\"1032192\"/E\n" "E/heapE\n" "Etotal type=\"fast\" count=\"0\" size=\"0\"/E\n" "Etotal type=\"rest\" count=\"0\" size=\"0\"/E\n" "Esystem type=\"current\" size=\"2113536\"/E\n" "Esystem type=\"max\" size=\"2113536\"/E\n" "Easpace type=\"total\" size=\"2113536\"/E\n" "Easpace type=\"mprotect\" size=\"2113536\"/E\n" "E/mallocE\n" msgstr "" "$ B\n" "glibc 2.13\n" "$ B<./a.out 1 10000 100>\n" "============ Avant allocation des blocs ============\n" "Emalloc version=\"1\"E\n" "Eheap nr=\"0\"E\n" "EsizesE\n" "E/sizesE\n" "Etotal type=\"fast\" count=\"0\" size=\"0\"/E\n" "Etotal type=\"rest\" count=\"0\" size=\"0\"/E\n" "Esystem type=\"current\" size=\"135168\"/E\n" "Esystem type=\"max\" size=\"135168\"/E\n" "Easpace type=\"total\" size=\"135168\"/E\n" "Easpace type=\"mprotect\" size=\"135168\"/E\n" "E/heapE\n" "Etotal type=\"fast\" count=\"0\" size=\"0\"/E\n" "Etotal type=\"rest\" count=\"0\" size=\"0\"/E\n" "Esystem type=\"current\" size=\"135168\"/E\n" "Esystem type=\"max\" size=\"135168\"/E\n" "Easpace type=\"total\" size=\"135168\"/E\n" "Easpace type=\"mprotect\" size=\"135168\"/E\n" "E/mallocE\n" "\\&\n" "============ Après allocation des blocs ============\n" "Emalloc version=\"1\"E\n" "Eheap nr=\"0\"E\n" "EsizesE\n" "E/sizesE\n" "Etotal type=\"fast\" count=\"0\" size=\"0\"/E\n" "Etotal type=\"rest\" count=\"0\" size=\"0\"/E\n" "Esystem type=\"current\" size=\"1081344\"/E\n" "Esystem type=\"max\" size=\"1081344\"/E\n" "Easpace type=\"total\" size=\"1081344\"/E\n" "Easpace type=\"mprotect\" size=\"1081344\"/E\n" "E/heapE\n" "Eheap nr=\"1\"E\n" "EsizesE\n" "E/sizesE\n" "Etotal type=\"fast\" count=\"0\" size=\"0\"/E\n" "Etotal type=\"rest\" count=\"0\" size=\"0\"/E\n" "Esystem type=\"current\" size=\"1032192\"/E\n" "Esystem type=\"max\" size=\"1032192\"/E\n" "Easpace type=\"total\" size=\"1032192\"/E\n" "Easpace type=\"mprotect\" size=\"1032192\"/E\n" "E/heapE\n" "Etotal type=\"fast\" count=\"0\" size=\"0\"/E\n" "Etotal type=\"rest\" count=\"0\" size=\"0\"/E\n" "Esystem type=\"current\" size=\"2113536\"/E\n" "Esystem type=\"max\" size=\"2113536\"/E\n" "Easpace type=\"total\" size=\"2113536\"/E\n" "Easpace type=\"mprotect\" size=\"2113536\"/E\n" "E/mallocE\n" #. type: SS #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "Program source" msgstr "Source du programme" #. type: Plain text #: archlinux debian-unstable fedora-40 fedora-rawhide mageia-cauldron #: opensuse-tumbleweed #, no-wrap msgid "" "#include Eerr.hE\n" "#include Eerrno.hE\n" "#include Emalloc.hE\n" "#include Epthread.hE\n" "#include Estdlib.hE\n" "#include Eunistd.hE\n" "\\&\n" "static size_t blockSize;\n" "static size_t numThreads;\n" "static unsigned int numBlocks;\n" "\\&\n" "static void *\n" "thread_func(void *arg)\n" "{\n" " int tn = (int) arg;\n" "\\&\n" " /* The multiplier \\[aq](2 + tn)\\[aq] ensures that each thread (including\n" " the main thread) allocates a different amount of memory. */\n" "\\&\n" " for (unsigned int j = 0; j E numBlocks; j++)\n" " if (malloc(blockSize * (2 + tn)) == NULL)\n" " err(EXIT_FAILURE, \"malloc-thread\");\n" "\\&\n" " sleep(100); /* Sleep until main thread terminates. */\n" " return NULL;\n" "}\n" "\\&\n" "int\n" "main(int argc, char *argv[])\n" "{\n" " int sleepTime;\n" " pthread_t *thr;\n" "\\&\n" " if (argc E 4) {\n" " fprintf(stderr,\n" " \"%s num-threads num-blocks block-size [sleep-time]\\en\",\n" " argv[0]);\n" " exit(EXIT_FAILURE);\n" " }\n" "\\&\n" " numThreads = atoi(argv[1]);\n" " numBlocks = atoi(argv[2]);\n" " blockSize = atoi(argv[3]);\n" " sleepTime = (argc E 4) ? atoi(argv[4]) : 0;\n" "\\&\n" " thr = calloc(numThreads, sizeof(*thr));\n" " if (thr == NULL)\n" " err(EXIT_FAILURE, \"calloc\");\n" "\\&\n" " printf(\"============ Before allocating blocks ============\\en\");\n" " malloc_info(0, stdout);\n" "\\&\n" " /* Create threads that allocate different amounts of memory. */\n" "\\&\n" " for (size_t tn = 0; tn E numThreads; tn++) {\n" " errno = pthread_create(&thr[tn], NULL, thread_func,\n" " (void *) tn);\n" " if (errno != 0)\n" " err(EXIT_FAILURE, \"pthread_create\");\n" "\\&\n" " /* If we add a sleep interval after the start-up of each\n" " thread, the threads likely won\\[aq]t contend for malloc\n" " mutexes, and therefore additional arenas won\\[aq]t be\n" " allocated (see malloc(3)). */\n" "\\&\n" " if (sleepTime E 0)\n" " sleep(sleepTime);\n" " }\n" "\\&\n" " /* The main thread also allocates some memory. */\n" "\\&\n" " for (unsigned int j = 0; j E numBlocks; j++)\n" " if (malloc(blockSize) == NULL)\n" " err(EXIT_FAILURE, \"malloc\");\n" "\\&\n" " sleep(2); /* Give all threads a chance to\n" " complete allocations. */\n" "\\&\n" " printf(\"\\en============ After allocating blocks ============\\en\");\n" " malloc_info(0, stdout);\n" "\\&\n" " exit(EXIT_SUCCESS);\n" "}\n" msgstr "" "#include Eerr.hE\n" "#include Eerrno.hE\n" "#include Emalloc.hE\n" "#include Epthread.hE\n" "#include Estdlib.hE\n" "#include Eunistd.hE\n" "\\&\n" "static size_t tailleBloc;\n" "static size_t numThreads;\n" "static unsigned int numBlocks;\n" "\\&\n" "static void *\n" "thread_func(void *arg)\n" "{\n" " int tn = (int) arg;\n" "\\&\n" " /* Le multiplicateur \\[aq](2 + tn)\\[aq] assure que chaque thread (dont\n" " le thread principal) alloue une quantité de mémoire différente. */\n" "\\&\n" " for (unsigned int j = 0; j E numBlocks; j++)\n" " if (malloc(blockSize * (2 + tn)) == NULL)\n" " err(EXIT_FAILURE, \"malloc-thread\");\n" "\\&\n" " sleep(100); /* Attendre que le thread principal se termine. */\n" " return NULL;\n" "}\n" "\\&\n" "int\n" "main(int argc, char *argv[])\n" "{\n" " int sleepTime;\n" " pthread_t *thr;\n" "\\&\n" " if (argc E 4) {\n" " fprintf(stderr,\n" " \"%s nb-threads nb-blocs taille-bloc [tps-sommeil]\\en\",\n" " argv[0]);\n" " exit(EXIT_FAILURE);\n" " }\n" "\\&\n" " numThreads = atoi(argv[1]);\n" " numBlocks = atoi(argv[2]);\n" " blockSize = atoi(argv[3]);\n" " sleepTime = (argc E 4) ? atoi(argv[4]) : 0;\n" "\\&\n" " thr = calloc(numThreads, sizeof(*thr));\n" " if (thr == NULL)\n" " err(EXIT_FAILURE, \"calloc\");\n" "\\&\n" " printf(\"============ Avant allocation des blocs ============\\en\");\n" " malloc_info(0, stdout);\n" "\\&\n" " /* Créer les threads allouant des quantités de mémoire différentes. */\n" "\\&\n" " for (size_t tn = 0; tn E numThreads; tn++) {\n" " errno = pthread_create(&thr[tn], NULL, thread_func,\n" " (void *) tn);\n" " if (errno != 0)\n" " err(EXIT_FAILURE, \"pthread_create\");\n" "\\&\n" " /* Si un intervalle de sommeil existe après le démarrage de\n" " chaque thread, les threads ne vont sans doute pas se battre\n" " pour les mutex malloc et par conséquent les domaines de mémoire\n" " supplémentaires ne seront pas alloués (consultez malloc(3)).\n" " */\n" "\\&\n" " if (sleepTime E 0)\n" " sleep(sleepTime);\n" " }\n" "\\&\n" " /* Le thread principal alloue également de la mémoire. */\n" "\\&\n" " for (unsigned int j = 0; j E numBlocks; j++)\n" " if (malloc(blockSize) == NULL)\n" " err(EXIT_FAILURE, \"malloc\");\n" "\\&\n" " sleep(2); /* Donner à tous les threads une chance\n" " de terminer les allocations. */\n" "\\&\n" " printf(\"\\en============ Après allocation des blocs ============\\en\");\n" " malloc_info(0, stdout);\n" "\\&\n" " exit(EXIT_SUCCESS);\n" "}\n" #. SRC END #. type: SH #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed #, no-wrap msgid "SEE ALSO" msgstr "VOIR AUSSI" #. type: Plain text #: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide #: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed msgid "" "B(3), B(3), B(3), B(3), " "B(3)" msgstr "" "B(3), B(3), B(3), B(3), " "B(3)" #. type: TH #: debian-bookworm #, no-wrap msgid "2023-02-05" msgstr "5 février 2023" #. type: TH #: debian-bookworm #, no-wrap msgid "Linux man-pages 6.03" msgstr "Pages du manuel de Linux 6.03" #. type: SH #: debian-bookworm #, no-wrap msgid "VERSIONS" msgstr "VERSIONS" #. type: Plain text #: debian-bookworm msgid "B() was added in glibc 2.10." msgstr "B() a été ajoutée dans la glibc\\ 2.10." #. type: Plain text #: debian-bookworm msgid "This function is a GNU extension." msgstr "Cette fonction est une extension GNU." #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid "" "$ B\n" "glibc 2.13\n" "$ B<./a.out 1 10000 100>\n" "============ Before allocating blocks ============\n" "Emalloc version=\"1\"E\n" "Eheap nr=\"0\"E\n" "EsizesE\n" "E/sizesE\n" "Etotal type=\"fast\" count=\"0\" size=\"0\"/E\n" "Etotal type=\"rest\" count=\"0\" size=\"0\"/E\n" "Esystem type=\"current\" size=\"135168\"/E\n" "Esystem type=\"max\" size=\"135168\"/E\n" "Easpace type=\"total\" size=\"135168\"/E\n" "Easpace type=\"mprotect\" size=\"135168\"/E\n" "E/heapE\n" "Etotal type=\"fast\" count=\"0\" size=\"0\"/E\n" "Etotal type=\"rest\" count=\"0\" size=\"0\"/E\n" "Esystem type=\"current\" size=\"135168\"/E\n" "Esystem type=\"max\" size=\"135168\"/E\n" "Easpace type=\"total\" size=\"135168\"/E\n" "Easpace type=\"mprotect\" size=\"135168\"/E\n" "E/mallocE\n" msgstr "" "$ B\n" "glibc 2.13\n" "$ B<./a.out 1 10000 100>\n" "============ Avant allocation des blocs ============\n" "Emalloc version=\"1\"E\n" "Eheap nr=\"0\"E\n" "EsizesE\n" "E/sizesE\n" "Etotal type=\"fast\" count=\"0\" size=\"0\"/E\n" "Etotal type=\"rest\" count=\"0\" size=\"0\"/E\n" "Esystem type=\"current\" size=\"135168\"/E\n" "Esystem type=\"max\" size=\"135168\"/E\n" "Easpace type=\"total\" size=\"135168\"/E\n" "Easpace type=\"mprotect\" size=\"135168\"/E\n" "E/heapE\n" "Etotal type=\"fast\" count=\"0\" size=\"0\"/E\n" "Etotal type=\"rest\" count=\"0\" size=\"0\"/E\n" "Esystem type=\"current\" size=\"135168\"/E\n" "Esystem type=\"max\" size=\"135168\"/E\n" "Easpace type=\"total\" size=\"135168\"/E\n" "Easpace type=\"mprotect\" size=\"135168\"/E\n" "E/mallocE\n" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid "" "============ After allocating blocks ============\n" "Emalloc version=\"1\"E\n" "Eheap nr=\"0\"E\n" "EsizesE\n" "E/sizesE\n" "Etotal type=\"fast\" count=\"0\" size=\"0\"/E\n" "Etotal type=\"rest\" count=\"0\" size=\"0\"/E\n" "Esystem type=\"current\" size=\"1081344\"/E\n" "Esystem type=\"max\" size=\"1081344\"/E\n" "Easpace type=\"total\" size=\"1081344\"/E\n" "Easpace type=\"mprotect\" size=\"1081344\"/E\n" "E/heapE\n" "Eheap nr=\"1\"E\n" "EsizesE\n" "E/sizesE\n" "Etotal type=\"fast\" count=\"0\" size=\"0\"/E\n" "Etotal type=\"rest\" count=\"0\" size=\"0\"/E\n" "Esystem type=\"current\" size=\"1032192\"/E\n" "Esystem type=\"max\" size=\"1032192\"/E\n" "Easpace type=\"total\" size=\"1032192\"/E\n" "Easpace type=\"mprotect\" size=\"1032192\"/E\n" "E/heapE\n" "Etotal type=\"fast\" count=\"0\" size=\"0\"/E\n" "Etotal type=\"rest\" count=\"0\" size=\"0\"/E\n" "Esystem type=\"current\" size=\"2113536\"/E\n" "Esystem type=\"max\" size=\"2113536\"/E\n" "Easpace type=\"total\" size=\"2113536\"/E\n" "Easpace type=\"mprotect\" size=\"2113536\"/E\n" "E/mallocE\n" msgstr "" "============ Après allocation des blocs ============\n" "Emalloc version=\"1\"E\n" "Eheap nr=\"0\"E\n" "EsizesE\n" "E/sizesE\n" "Etotal type=\"fast\" count=\"0\" size=\"0\"/E\n" "Etotal type=\"rest\" count=\"0\" size=\"0\"/E\n" "Esystem type=\"current\" size=\"1081344\"/E\n" "Esystem type=\"max\" size=\"1081344\"/E\n" "Easpace type=\"total\" size=\"1081344\"/E\n" "Easpace type=\"mprotect\" size=\"1081344\"/E\n" "E/heapE\n" "Eheap nr=\"1\"E\n" "EsizesE\n" "E/sizesE\n" "Etotal type=\"fast\" count=\"0\" size=\"0\"/E\n" "Etotal type=\"rest\" count=\"0\" size=\"0\"/E\n" "Esystem type=\"current\" size=\"1032192\"/E\n" "Esystem type=\"max\" size=\"1032192\"/E\n" "Easpace type=\"total\" size=\"1032192\"/E\n" "Easpace type=\"mprotect\" size=\"1032192\"/E\n" "E/heapE\n" "Etotal type=\"fast\" count=\"0\" size=\"0\"/E\n" "Etotal type=\"rest\" count=\"0\" size=\"0\"/E\n" "Esystem type=\"current\" size=\"2113536\"/E\n" "Esystem type=\"max\" size=\"2113536\"/E\n" "Easpace type=\"total\" size=\"2113536\"/E\n" "Easpace type=\"mprotect\" size=\"2113536\"/E\n" "E/mallocE\n" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid "" "#include Eerr.hE\n" "#include Eerrno.hE\n" "#include Emalloc.hE\n" "#include Epthread.hE\n" "#include Estdlib.hE\n" "#include Eunistd.hE\n" msgstr "" "#include Eerr.hE\n" "#include Eerrno.hE\n" "#include Emalloc.hE\n" "#include Epthread.hE\n" "#include Estdlib.hE\n" "#include Eunistd.hE\n" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid "" "static size_t blockSize;\n" "static size_t numThreads;\n" "static unsigned int numBlocks;\n" msgstr "" "static size_t tailleBloc;\n" "static size_t numThreads;\n" "static unsigned int numBlocks;\n" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid "" "static void *\n" "thread_func(void *arg)\n" "{\n" " int tn = (int) arg;\n" msgstr "" "static void *\n" "thread_func(void *arg)\n" "{\n" " int tn = (int) arg;\n" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid "" " /* The multiplier \\[aq](2 + tn)\\[aq] ensures that each thread (including\n" " the main thread) allocates a different amount of memory. */\n" msgstr "" " /* Le multiplicateur \\[aq](2 + tn)\\[aq] assure que chaque thread (dont\n" " le thread principal) alloue une quantité de mémoire différente. */\n" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid "" " for (unsigned int j = 0; j E numBlocks; j++)\n" " if (malloc(blockSize * (2 + tn)) == NULL)\n" " err(EXIT_FAILURE, \"malloc-thread\");\n" msgstr "" " for (unsigned int j = 0; j E numBlocks; j++)\n" " if (malloc(blockSize * (2 + tn)) == NULL)\n" " err(EXIT_FAILURE, \"malloc-thread\");\n" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid "" " sleep(100); /* Sleep until main thread terminates. */\n" " return NULL;\n" "}\n" msgstr "" " sleep(100); /* Attendre que le thread principal se termine. */\n" " return NULL;\n" "}\n" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid "" "int\n" "main(int argc, char *argv[])\n" "{\n" " int sleepTime;\n" " pthread_t *thr;\n" msgstr "" "int\n" "main(int argc, char *argv[])\n" "{\n" " int tpsSommeil;\n" " pthread_t *thr;\n" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid "" " if (argc E 4) {\n" " fprintf(stderr,\n" " \"%s num-threads num-blocks block-size [sleep-time]\\en\",\n" " argv[0]);\n" " exit(EXIT_FAILURE);\n" " }\n" msgstr "" " if (argc E 4) {\n" " fprintf(stderr,\n" " \"%s nb-threads nb-blocs taille-bloc [tps-sommeil]\\en\",\n" " argv[0]);\n" " exit(EXIT_FAILURE);\n" " }\n" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid "" " numThreads = atoi(argv[1]);\n" " numBlocks = atoi(argv[2]);\n" " blockSize = atoi(argv[3]);\n" " sleepTime = (argc E 4) ? atoi(argv[4]) : 0;\n" msgstr "" " nbThreads = atoi(argv[1]);\n" " nbBlocs = atoi(argv[2]);\n" " tailleBloc = atoi(argv[3]);\n" " tpsSommeil = (argc E 4) ? atoi(argv[4]) : 0;\n" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid "" " thr = calloc(numThreads, sizeof(*thr));\n" " if (thr == NULL)\n" " err(EXIT_FAILURE, \"calloc\");\n" msgstr "" " thr = calloc(numThreads, sizeof(*thr));\n" " if (thr == NULL)\n" " err(EXIT_FAILURE, \"calloc\");\n" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid "" " printf(\"============ Before allocating blocks ============\\en\");\n" " malloc_info(0, stdout);\n" msgstr "" " printf(\"============ Avant allocation des blocs ============\\en\");\n" " malloc_info(0, stdout);\n" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid " /* Create threads that allocate different amounts of memory. */\n" msgstr " /* Créer les threads allouant des quantités de mémoire différentes. */\n" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid "" " for (size_t tn = 0; tn E numThreads; tn++) {\n" " errno = pthread_create(&thr[tn], NULL, thread_func,\n" " (void *) tn);\n" " if (errno != 0)\n" " err(EXIT_FAILURE, \"pthread_create\");\n" msgstr "" " for (size_t tn = 0; tn E numThreads; tn++) {\n" " errno = pthread_create(&thr[tn], NULL, thread_func,\n" " (void *) tn);\n" " if (errno != 0)\n" " err(EXIT_FAILURE, \"pthread_create\");\n" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid "" " /* If we add a sleep interval after the start-up of each\n" " thread, the threads likely won\\[aq]t contend for malloc\n" " mutexes, and therefore additional arenas won\\[aq]t be\n" " allocated (see malloc(3)). */\n" msgstr "" " /* Si un intervalle de sommeil existe après le démarrage de\n" " chaque thread, les threads ne vont sans doute pas se battre\n" " pour les mutex malloc et par conséquent les domaines de mémoire\n" " supplémentaires ne seront pas alloués (consultez malloc(3)).\n" " */\n" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid "" " if (sleepTime E 0)\n" " sleep(sleepTime);\n" " }\n" msgstr "" " if (tpsSommeil E 0)\n" " sleep(tpsSommeil);\n" " }\n" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid " /* The main thread also allocates some memory. */\n" msgstr " /* Le thread principal alloue également de la mémoire. */\n" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid "" " for (unsigned int j = 0; j E numBlocks; j++)\n" " if (malloc(blockSize) == NULL)\n" " err(EXIT_FAILURE, \"malloc\");\n" msgstr "" " for (unsigned int j = 0; j E numBlocks; j++)\n" " if (malloc(blockSize) == NULL)\n" " err(EXIT_FAILURE, \"malloc\");\n" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid "" " sleep(2); /* Give all threads a chance to\n" " complete allocations. */\n" msgstr "" " sleep(2); /* Donner à tous les threads une chance\n" " de terminer les allocations. */\n" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid "" " printf(\"\\en============ After allocating blocks ============\\en\");\n" " malloc_info(0, stdout);\n" msgstr "" " printf(\"\\en============ Après allocation des blocs ============\\en\");\n" " malloc_info(0, stdout);\n" #. type: Plain text #: debian-bookworm opensuse-leap-15-6 #, no-wrap msgid "" " exit(EXIT_SUCCESS);\n" "}\n" msgstr "" " exit(EXIT_SUCCESS);\n" "}\n" #. type: TH #: fedora-40 mageia-cauldron #, no-wrap msgid "2023-10-31" msgstr "31 octobre 2023" #. type: TH #: fedora-40 mageia-cauldron #, no-wrap msgid "Linux man-pages 6.06" msgstr "Pages du manuel de Linux 6.06" #. type: TH #: fedora-rawhide #, no-wrap msgid "2024-02-26" msgstr "26 février 2024" #. type: TH #: fedora-rawhide #, no-wrap msgid "Linux man-pages 6.7" msgstr "Pages du manuel de Linux 6.7" #. type: TH #: opensuse-leap-15-6 #, no-wrap msgid "2023-03-30" msgstr "30 mars 2023" #. type: TH #: opensuse-leap-15-6 #, no-wrap msgid "Linux man-pages 6.04" msgstr "Pages du manuel de Linux 6.04" #. type: TH #: opensuse-tumbleweed #, no-wrap msgid "Linux man-pages (unreleased)" msgstr "Pages du manuel de Linux (non publiées)"