perkamon - en to fr translation catalogue (45 entries)

note: type: TH
en: 2019-03-06
fr: 6 mars 2019

note: type: TH
en: Linux Programmer's Manual
fr: Manuel du programmeur Linux

note: type: SH
en: NAME
fr: NOM

note: type: Plain text
en: malloc_info - export malloc state to a stream
fr: malloc_info - Exporter l'état de malloc vers un flux

note: type: Plain text
en: As currently implemented, I<options> must be zero.
fr: Dans la mise en œuvre actuelle, le paramètre I<options> doit être nul.

note: type: SH
en: RETURN VALUE
fr: VALEUR DE RETOUR

note: type: Plain text
en: On success, B<malloc_info>()  returns 0; on error, it returns -1, with I<errno> set to indicate the cause.
fr: En cas de succès, B<malloc_info>() renvoie zéro. En cas d'erreur, -1 est renvoyé et I<errno> contient le code d'erreur.

note: type: SH
en: ERRORS
fr: ERREURS

note: type: Plain text
en: I<options> was nonzero.
fr: Le paramètre I<options> n'était pas nul.

note: type: Plain text
en: B<malloc_info>()  was added to glibc in version 2.10.
fr: B<malloc_info>() est disponible depuis la glibc 2.10.

note: type: SH
en: ATTRIBUTES
fr: ATTRIBUTS

note: type: tbl table
en: Value
fr: Valeur

note: type: SH
en: CONFORMING TO
fr: CONFORMITÉ

note: type: Plain text
en: This function is a GNU extension.
fr: Cette fonction est une extension GNU.

note: type: Plain text
en: 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.
fr: 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.

note: type: Plain text
en: The B<open_memstream>(3)  function can be used to send the output of B<malloc_info>()  directly into a buffer in memory, rather than to a file.
fr: La fonction B<open_memstream>(3) peut être utilisée pour envoyer la sortie de B<malloc_info>() directement dans un tampon en mémoire plutôt que dans un fichier.

note: type: Plain text
en: The B<malloc_info>()  function is designed to address deficiencies in B<malloc_stats>(3)  and B<mallinfo>(3).
fr: La fonction B<malloc_info>() est conçue pour combler les manques de B<malloc_stats>(3) et B<mallinfo>(3).

note: type: SH
en: EXAMPLE
fr: EXEMPLE

note: type: Plain text
en: 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.
fr: 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, ainsi de suite.

note: type: Plain text
en: The program calls B<malloc_info>()  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.
fr: Le programme appelle B<malloc_info>() deux fois pour afficher l'état de l'allocation mémoire. Le premier appel est effectué avant la création de 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.

note: type: Plain text
en: 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<malloc_info>()  shows the state of two allocation arenas.
fr: Dans l'exemple suivant, les paramètres commandent la création d'un thread additionnel, allouant 10000 blocs de mémoire, comme le thread principal. Une fois les blocs de mémoire alloués, B<malloc_info>() affiche l'état des deux enclos mémoire.

note: type: Plain text
en: $ B<getconf GNU_LIBC_VERSION>
    glibc 2.13
    $ B<./a.out 1 10000 100>
    ============ Before allocating blocks ============
    E<lt>malloc version="1"E<gt>
    E<lt>heap nr="0"E<gt>
    E<lt>sizesE<gt>
    E<lt>/sizesE<gt>
    E<lt>total type="fast" count="0" size="0"/E<gt>
    E<lt>total type="rest" count="0" size="0"/E<gt>
    E<lt>system type="current" size="135168"/E<gt>
    E<lt>system type="max" size="135168"/E<gt>
    E<lt>aspace type="total" size="135168"/E<gt>
    E<lt>aspace type="mprotect" size="135168"/E<gt>
    E<lt>/heapE<gt>
    E<lt>total type="fast" count="0" size="0"/E<gt>
    E<lt>total type="rest" count="0" size="0"/E<gt>
    E<lt>system type="current" size="135168"/E<gt>
    E<lt>system type="max" size="135168"/E<gt>
    E<lt>aspace type="total" size="135168"/E<gt>
    E<lt>aspace type="mprotect" size="135168"/E<gt>
    E<lt>/mallocE<gt>
fr: $ B<getconf GNU_LIBC_VERSION>
    glibc 2.13
    $ B<./a.out 1 10000 100>
    ============ Avant allocation des blocs ============
    E<lt>malloc version="1"E<gt>
    E<lt>heap nr="0"E<gt>
    E<lt>sizesE<gt>
    E<lt>/sizesE<gt>
    E<lt>total type="fast" count="0" size="0"/E<gt>
    E<lt>total type="rest" count="0" size="0"/E<gt>
    E<lt>system type="current" size="135168"/E<gt>
    E<lt>system type="max" size="135168"/E<gt>
    E<lt>aspace type="total" size="135168"/E<gt>
    E<lt>aspace type="mprotect" size="135168"/E<gt>
    E<lt>/heapE<gt>
    E<lt>total type="fast" count="0" size="0"/E<gt>
    E<lt>total type="rest" count="0" size="0"/E<gt>
    E<lt>system type="current" size="135168"/E<gt>
    E<lt>system type="max" size="135168"/E<gt>
    E<lt>aspace type="total" size="135168"/E<gt>
    E<lt>aspace type="mprotect" size="135168"/E<gt>
    E<lt>/mallocE<gt>

note: type: Plain text
en: ============ After allocating blocks ============
    E<lt>malloc version="1"E<gt>
    E<lt>heap nr="0"E<gt>
    E<lt>sizesE<gt>
    E<lt>/sizesE<gt>
    E<lt>total type="fast" count="0" size="0"/E<gt>
    E<lt>total type="rest" count="0" size="0"/E<gt>
    E<lt>system type="current" size="1081344"/E<gt>
    E<lt>system type="max" size="1081344"/E<gt>
    E<lt>aspace type="total" size="1081344"/E<gt>
    E<lt>aspace type="mprotect" size="1081344"/E<gt>
    E<lt>/heapE<gt>
    E<lt>heap nr="1"E<gt>
    E<lt>sizesE<gt>
    E<lt>/sizesE<gt>
    E<lt>total type="fast" count="0" size="0"/E<gt>
    E<lt>total type="rest" count="0" size="0"/E<gt>
    E<lt>system type="current" size="1032192"/E<gt>
    E<lt>system type="max" size="1032192"/E<gt>
    E<lt>aspace type="total" size="1032192"/E<gt>
    E<lt>aspace type="mprotect" size="1032192"/E<gt>
    E<lt>/heapE<gt>
    E<lt>total type="fast" count="0" size="0"/E<gt>
    E<lt>total type="rest" count="0" size="0"/E<gt>
    E<lt>system type="current" size="2113536"/E<gt>
    E<lt>system type="max" size="2113536"/E<gt>
    E<lt>aspace type="total" size="2113536"/E<gt>
    E<lt>aspace type="mprotect" size="2113536"/E<gt>
    E<lt>/mallocE<gt>
fr: ============ Après allocation des blocs ============
    E<lt>malloc version="1"E<gt>
    E<lt>heap nr="0"E<gt>
    E<lt>sizesE<gt>
    E<lt>/sizesE<gt>
    E<lt>total type="fast" count="0" size="0"/E<gt>
    E<lt>total type="rest" count="0" size="0"/E<gt>
    E<lt>system type="current" size="1081344"/E<gt>
    E<lt>system type="max" size="1081344"/E<gt>
    E<lt>aspace type="total" size="1081344"/E<gt>
    E<lt>aspace type="mprotect" size="1081344"/E<gt>
    E<lt>/heapE<gt>
    E<lt>heap nr="1"E<gt>
    E<lt>sizesE<gt>
    E<lt>/sizesE<gt>
    E<lt>total type="fast" count="0" size="0"/E<gt>
    E<lt>total type="rest" count="0" size="0"/E<gt>
    E<lt>system type="current" size="1032192"/E<gt>
    E<lt>system type="max" size="1032192"/E<gt>
    E<lt>aspace type="total" size="1032192"/E<gt>
    E<lt>aspace type="mprotect" size="1032192"/E<gt>
    E<lt>/heapE<gt>
    E<lt>total type="fast" count="0" size="0"/E<gt>
    E<lt>total type="rest" count="0" size="0"/E<gt>
    E<lt>system type="current" size="2113536"/E<gt>
    E<lt>system type="max" size="2113536"/E<gt>
    E<lt>aspace type="total" size="2113536"/E<gt>
    E<lt>aspace type="mprotect" size="2113536"/E<gt>
    E<lt>/mallocE<gt>

note: type: SS
en: Program source
fr: Source du programme

note: type: Plain text
en: static size_t blockSize;
    static int numThreads, numBlocks;
fr: static size_t tailleBloc;
    static int nbThreads, nbBlocs;

note: type: Plain text
en:     /* The multiplier \(aq(2 + tn)\(aq ensures that each thread (including
           the main thread) allocates a different amount of memory */
fr:     /* Le multiplicateur \(aq(2 + tn)\(aq s'assure que chaque thread (dont
           le thread principal) alloue une quantité de mémoire différente */

note: type: Plain text
en:     for (j = 0; j E<lt> numBlocks; j++)
            if (malloc(blockSize * (2 + tn)) == NULL)
                errExit("malloc-thread");
fr:     for (j = 0; j E<lt> nbBlocs; j++)
            if (malloc(tailleBloc * (2 + tn)) == NULL)
                errExit("malloc-thread");

note: type: Plain text
en:     sleep(100);         /* Sleep until main thread terminates */
        return NULL;
    }
fr:     sleep(100);         /* Attendre que le thread principal se termine */
        return NULL;
    }

note: type: Plain text
en: int
    main(int argc, char *argv[])
    {
        int j, tn, sleepTime;
        pthread_t *thr;
fr: int
    main(int argc, char *argv[])
    {
        int j, tn, tpsSommeil;
        pthread_t *thr;

note: type: Plain text
en:     if (argc E<lt> 4) {
            fprintf(stderr,
                    "%s num-threads num-blocks block-size [sleep-time]\en",
                    argv[0]);
            exit(EXIT_FAILURE);
        }
fr:     if (argc E<lt> 4) {
            fprintf(stderr,
                    "%s nb-threads nb-blocs taille-bloc [tps-sommeil]\en",
                    argv[0]);
            exit(EXIT_FAILURE);
        }

note: type: Plain text
en:     numThreads = atoi(argv[1]);
        numBlocks = atoi(argv[2]);
        blockSize = atoi(argv[3]);
        sleepTime = (argc E<gt> 4) ? atoi(argv[4]) : 0;
fr:     nbThreads = atoi(argv[1]);
        nbBlocs = atoi(argv[2]);
        tailleBloc = atoi(argv[3]);
        tpsSommeil = (argc E<gt> 4) ? atoi(argv[4]) : 0;

note: type: Plain text
en:     thr = calloc(numThreads, sizeof(pthread_t));
        if (thr == NULL)
            errExit("calloc");
fr:     thr = calloc(nbThreads, sizeof(pthread_t));
        if (thr == NULL)
            errExit("calloc");

note: type: Plain text
en:     printf("============ Before allocating blocks ============\en");
        malloc_info(0, stdout);
fr:     printf("============ Avant allocation des blocs ============\en");
        malloc_info(0, stdout);

note: type: Plain text
en:     /* Create threads that allocate different amounts of memory */
fr:     /* Crée les threads allouant des quantités de mémoire différentes */

note: type: Plain text
en:     for (tn = 0; tn E<lt> numThreads; tn++) {
            errno = pthread_create(&thr[tn], NULL, thread_func,
                                   (void *) tn);
            if (errno != 0)
                errExit("pthread_create");
fr:     for (tn = 0; tn E<lt> nbThreads; tn++) {
            errno = pthread_create(&thr[tn], NULL, thread_func,
                                   (void *) tn);
            if (errno != 0)
                errExit("pthread_create");

note: type: Plain text
en:         /* If we add a sleep interval after the start-up of each
               thread, the threads likely won\(aqt contend for malloc
               mutexes, and therefore additional arenas won\(aqt be
               allocated (see malloc(3)). */
fr:         /* Si un intervalle de sommeil existe après le démarrage de
               chaque thread, les threads ne vont sans doute pas se battre
               pour les mutex malloc, et par conséquent les enclos mémoire
               supplémentaires ne seront pas alloués (consultez malloc(3)).
               */

note: type: Plain text
en:         if (sleepTime E<gt> 0)
                sleep(sleepTime);
        }
fr:         if (tpsSommeil E<gt> 0)
                sleep(tpsSommeil);
        }

note: type: Plain text
en:     /* The main thread also allocates some memory */
fr:     /* Le thread principal alloue également de la mémoire */

note: type: Plain text
en:     for (j = 0; j E<lt> numBlocks; j++)
            if (malloc(blockSize) == NULL)
                errExit("malloc");
fr:     for (j = 0; j E<lt> nbBlocs; j++)
            if (malloc(tailleBloc) == NULL)
                errExit("malloc");

note: type: Plain text
en:     sleep(2);           /* Give all threads a chance to
                               complete allocations */
fr:     sleep(2);           /* Donne à tous les threads une chance
                               de terminer les allocations */

note: type: Plain text
en:     printf("\en============ After allocating blocks ============\en");
        malloc_info(0, stdout);
fr:     printf("\en============ Après allocation des blocs ============\en");
        malloc_info(0, stdout);

note: type: SH
en: SEE ALSO
fr: VOIR AUSSI

note: type: Plain text
en: This page is part of release 5.03 of the Linux I<man-pages> project.  A description of the project, information about reporting bugs, and the latest version of this page, can be found at \%https://www.kernel.org/doc/man-pages/.
fr: Cette page fait partie de la publication 5.03 du projet I<man-pages> Linux. Une description du projet et des instructions pour signaler des anomalies peuvent être trouvées à l'adresse \%https://www.kernel.org/doc/man-pages/.

note: type: Plain text
en: This page is part of release 5.02 of the Linux I<man-pages> project.  A description of the project, information about reporting bugs, and the latest version of this page, can be found at \%https://www.kernel.org/doc/man-pages/.
fr: Cette page fait partie de la publication 5.02 du projet I<man-pages> Linux. Une description du projet et des instructions pour signaler des anomalies peuvent être trouvées à l'adresse \%https://www.kernel.org/doc/man-pages/.

note: type: Plain text
en: This page is part of release 5.01 of the Linux I<man-pages> project.  A description of the project, information about reporting bugs, and the latest version of this page, can be found at \%https://www.kernel.org/doc/man-pages/.
fr: Cette page fait partie de la publication 5.01 du projet I<man-pages> Linux. Une description du projet et des instructions pour signaler des anomalies peuvent être trouvées à l'adresse \%https://www.kernel.org/doc/man-pages/.
