Debian Codegraph @

po/fr/man3/malloc_info.3.po

raw
1 # French translation of manpages
2 # This file is distributed under the same license as the manpages-l10n package.
3 # Copyright © of this file:
4 # Christophe Blaess <https://www.blaess.fr/christophe/>, 1996-2003.
5 # Stéphan Rafin <[email protected]>, 2002.
6 # Thierry Vignaud <[email protected]>, 1999,2002.
7 # François Micaux, 2002.
8 # Alain Portal <[email protected]>, 2003-2008.
9 # Jean-Philippe Guérard <[email protected]>, 2005-2006.
10 # Jean-Luc Coulon (f5ibh) <[email protected]>, 2006-2007.
11 # Julien Cristau <[email protected]>, 2006-2007.
12 # Thomas Huriaux <[email protected]>, 2006-2008.
13 # Nicolas François <[email protected]>, 2006-2008.
14 # Florentin Duneau <[email protected]>, 2006-2010.
15 # Simon Paillard <[email protected]>, 2006, 2012-2014.
16 # Denis Barbier <[email protected]>, 2006,2010.
17 # David Prévot <[email protected]>, 2010-2014.
18 # Grégoire Scano <[email protected]>, 2020-2021.
19 msgid ""
20 msgstr ""
21 "Project-Id-Version: manpages-l10n 4.22.0\n"
22 "POT-Creation-Date: 2026-06-05 06:30+0200\n"
23 "PO-Revision-Date: 2024-05-07 17:35+0200\n"
24 "Last-Translator: Grégoire Scano <[email protected]>\n"
25 "Language-Team: French <[email protected]>\n"
26 "Language: fr\n"
27 "MIME-Version: 1.0\n"
28 "Content-Type: text/plain; charset=UTF-8\n"
29 "Content-Transfer-Encoding: 8bit\n"
30 "Plural-Forms: nplurals=2; plural=n > 1;\n"
31 "X-Generator: Lokalize 22.12.3\n"
32
33 #. type: TH
34 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
35 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
36 #, no-wrap
37 msgid "malloc_info"
38 msgstr "malloc_info"
39
40 #. type: TH
41 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
42 #: opensuse-tumbleweed
43 #, no-wrap
44 msgid "2026-02-08"
45 msgstr "8 février 2026"
46
47 #. type: TH
48 #: archlinux debian-unstable
49 #, no-wrap
50 msgid "Linux man-pages 6.18"
51 msgstr "Pages du manuel de Linux 6.18"
52
53 #. type: SH
54 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
55 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
56 #, no-wrap
57 msgid "NAME"
58 msgstr "NOM"
59
60 #. type: Plain text
61 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
62 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
63 msgid "malloc_info - export malloc state to a stream"
64 msgstr "malloc_info - Exporter l'état de malloc vers un flux"
65
66 #. type: SH
67 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
68 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
69 #, no-wrap
70 msgid "LIBRARY"
71 msgstr "BIBLIOTHÈQUE"
72
73 #. type: Plain text
74 #: archlinux debian-unstable fedora-44 fedora-rawhide mageia-cauldron
75 #: opensuse-leap-16-1 opensuse-tumbleweed
76 msgid "Standard C library (I<libc>,\\ I<-lc>)"
77 msgstr "Bibliothèque C standard (I<libc>,\\ I<-lc>)"
78
79 #. type: SH
80 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
81 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
82 #, no-wrap
83 msgid "SYNOPSIS"
84 msgstr "SYNOPSIS"
85
86 #. type: Plain text
87 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
88 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
89 #, no-wrap
90 msgid "B<#include E<lt>malloc.hE<gt>>\n"
91 msgstr "B<#include E<lt>malloc.hE<gt>>\n"
92
93 #. type: Plain text
94 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
95 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
96 #, no-wrap
97 msgid "B<int malloc_info(int >I<options>B<, FILE *>I<stream>B<);>\n"
98 msgstr "B<int malloc_info(int >I<options>B<, FILE *>I<stream>B<);>\n"
99
100 #. type: SH
101 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
102 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
103 #, no-wrap
104 msgid "DESCRIPTION"
105 msgstr "DESCRIPTION"
106
107 #. type: Plain text
108 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
109 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
110 msgid ""
111 "The B<malloc_info>() function exports an XML string that describes the "
112 "current state of the memory-allocation implementation in the caller. The "
113 "string is printed on the file stream I<stream>. The exported string "
114 "includes information about all arenas (see B<malloc>(3))."
115 msgstr ""
116 "La fonction B<malloc_info>() exporte une chaîne XML décrivant l'état actuel "
117 "de l'allocation mémoire pour l'appelant. Cette chaîne est écrite dans le "
118 "flux I<stream>. La chaîne exportée contient des informations concernant "
119 "toutes les domaines de mémoires (« arenas », consultez B<malloc>(3))."
120
121 #. type: Plain text
122 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
123 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
124 msgid "As currently implemented, I<options> must be zero."
125 msgstr "Dans la mise en œuvre actuelle, le paramètre I<options> doit être nul."
126
127 #. type: SH
128 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
129 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
130 #, no-wrap
131 msgid "RETURN VALUE"
132 msgstr "VALEUR RENVOYÉE"
133
134 #. type: Plain text
135 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
136 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
137 msgid ""
138 "On success, B<malloc_info>() returns 0. On failure, it returns -1, and "
139 "I<errno> is set to indicate the error."
140 msgstr ""
141 "En cas de succès, B<malloc_info>() renvoie B<0>. En cas d'erreur, B<-1> est "
142 "renvoyé et I<errno> contient le code d'erreur."
143
144 #. type: SH
145 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
146 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
147 #, no-wrap
148 msgid "ERRORS"
149 msgstr "ERREURS"
150
151 #. type: TP
152 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
153 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
154 #, no-wrap
155 msgid "B<EINVAL>"
156 msgstr "B<EINVAL>"
157
158 #. type: Plain text
159 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
160 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
161 msgid "I<options> was nonzero."
162 msgstr "Le paramètre I<options> n'était pas nul."
163
164 #. type: SH
165 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
166 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
167 #, no-wrap
168 msgid "ATTRIBUTES"
169 msgstr "ATTRIBUTS"
170
171 #. type: Plain text
172 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
173 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
174 msgid ""
175 "For an explanation of the terms used in this section, see B<attributes>(7)."
176 msgstr ""
177 "Pour une explication des termes utilisés dans cette section, consulter "
178 "B<attributes>(7)."
179
180 #. type: tbl table
181 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
182 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
183 #, no-wrap
184 msgid "Interface"
185 msgstr "Interface"
186
187 #. type: tbl table
188 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
189 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
190 #, no-wrap
191 msgid "Attribute"
192 msgstr "Attribut"
193
194 #. type: tbl table
195 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
196 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
197 #, no-wrap
198 msgid "Value"
199 msgstr "Valeur"
200
201 #. type: tbl table
202 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
203 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
204 #, no-wrap
205 msgid ".na\n"
206 msgstr ".na\n"
207
208 #. type: tbl table
209 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
210 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
211 #, no-wrap
212 msgid ".nh\n"
213 msgstr ".nh\n"
214
215 #. type: tbl table
216 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
217 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
218 #, no-wrap
219 msgid "B<malloc_info>()"
220 msgstr "B<malloc_info>()"
221
222 #. type: tbl table
223 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
224 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
225 #, no-wrap
226 msgid "Thread safety"
227 msgstr "Sécurité des threads"
228
229 #. type: tbl table
230 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
231 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
232 #, no-wrap
233 msgid "MT-Safe"
234 msgstr "MT-Safe"
235
236 #. type: SH
237 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
238 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
239 #, no-wrap
240 msgid "STANDARDS"
241 msgstr "NORMES"
242
243 #. type: Plain text
244 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
245 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
246 msgid "GNU."
247 msgstr "GNU."
248
249 #. type: SH
250 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
251 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
252 #, no-wrap
253 msgid "HISTORY"
254 msgstr "HISTORIQUE"
255
256 #. type: Plain text
257 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
258 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
259 msgid "glibc 2.10."
260 msgstr "glibc 2.10."
261
262 #. type: SH
263 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
264 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
265 #, no-wrap
266 msgid "NOTES"
267 msgstr "NOTES"
268
269 #. type: Plain text
270 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
271 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
272 msgid ""
273 "The memory-allocation information is provided as an XML string (rather than "
274 "a C structure) because the information may change over time (according to "
275 "changes in the underlying implementation). The output XML string includes a "
276 "version field."
277 msgstr ""
278 "L'information d'allocation mémoire est fournie sous forme de flux XML "
279 "(plutôt que de structure C), car les informations fournies pourront évoluer "
280 "dans le futur, en raison de modifications dans le code mis en œuvre. La "
281 "sortie XML comporte un champ de version."
282
283 #. type: Plain text
284 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
285 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
286 msgid ""
287 "The B<open_memstream>(3) function can be used to send the output of "
288 "B<malloc_info>() directly into a buffer in memory, rather than to a file."
289 msgstr ""
290 "La fonction B<open_memstream>(3) peut être utilisée pour envoyer la sortie "
291 "de B<malloc_info>() directement dans un tampon en mémoire plutôt que dans un "
292 "fichier."
293
294 #. type: Plain text
295 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
296 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
297 msgid ""
298 "The B<malloc_info>() function is designed to address deficiencies in "
299 "B<malloc_stats>(3) and B<mallinfo>(3)."
300 msgstr ""
301 "La fonction B<malloc_info>() est conçue pour combler les manques de "
302 "B<malloc_stats>(3) et B<mallinfo>(3)."
303
304 #. type: SH
305 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
306 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
307 #, no-wrap
308 msgid "EXAMPLES"
309 msgstr "EXEMPLES"
310
311 #. type: Plain text
312 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
313 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
314 msgid ""
315 "The program below takes up to four command-line arguments, of which the "
316 "first three are mandatory. The first argument specifies the number of "
317 "threads that the program should create. All of the threads, including the "
318 "main thread, allocate the number of blocks of memory specified by the second "
319 "argument. The third argument controls the size of the blocks to be "
320 "allocated. The main thread creates blocks of this size, the second thread "
321 "created by the program allocates blocks of twice this size, the third thread "
322 "allocates blocks of three times this size, and so on."
323 msgstr ""
324 "Le programme ci-dessous accepte jusqu'à quatre paramètres en ligne de "
325 "commande dont les trois premiers sont obligatoires. Le premier paramètre "
326 "indique le nombre de processus légers (« threads ») que le programme doit "
327 "créer. Tous les threads, thread principal compris, allouent le nombre de "
328 "blocs de mémoire indiqué en deuxième paramètre. Le troisième paramètre "
329 "contrôle la taille des blocs à allouer. Le thread principal crée des blocs "
330 "de cette taille, le deuxième thread créé par le programme alloue des blocs "
331 "deux fois plus grands, le troisième thread alloue des blocs trois fois plus "
332 "grands et ainsi de suite."
333
334 #. type: Plain text
335 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
336 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
337 msgid ""
338 "The program calls B<malloc_info>() twice to display the memory-allocation "
339 "state. The first call takes place before any threads are created or memory "
340 "allocated. The second call is performed after all threads have allocated "
341 "memory."
342 msgstr ""
343 "Le programme appelle B<malloc_info>() deux fois pour afficher l'état de "
344 "l'allocation mémoire. Le premier appel est effectué avant la création d’un "
345 "thread ou l'allocation de mémoire. Le deuxième appel est effectué une fois "
346 "que tous les threads ont alloué de la mémoire."
347
348 #. type: Plain text
349 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
350 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
351 msgid ""
352 "In the following example, the command-line arguments specify the creation of "
353 "one additional thread, and both the main thread and the additional thread "
354 "allocate 10000 blocks of memory. After the blocks of memory have been "
355 "allocated, B<malloc_info>() shows the state of two allocation arenas."
356 msgstr ""
357 "Dans l'exemple suivant, les paramètres commandent la création d'un thread "
358 "additionnel, allouant 10 000 blocs de mémoire, comme le thread principal. "
359 "Une fois les blocs de mémoire alloués, B<malloc_info>() affiche l'état des "
360 "deux domaines de mémoire."
361
362 #. type: Plain text
363 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
364 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
365 #, no-wrap
366 msgid ""
367 "$ B<getconf GNU_LIBC_VERSION>\n"
368 "glibc 2.13\n"
369 "$ B<./a.out 1 10000 100>\n"
370 "============ Before allocating blocks ============\n"
371 "E<lt>malloc version=\"1\"E<gt>\n"
372 "E<lt>heap nr=\"0\"E<gt>\n"
373 "E<lt>sizesE<gt>\n"
374 "E<lt>/sizesE<gt>\n"
375 "E<lt>total type=\"fast\" count=\"0\" size=\"0\"/E<gt>\n"
376 "E<lt>total type=\"rest\" count=\"0\" size=\"0\"/E<gt>\n"
377 "E<lt>system type=\"current\" size=\"135168\"/E<gt>\n"
378 "E<lt>system type=\"max\" size=\"135168\"/E<gt>\n"
379 "E<lt>aspace type=\"total\" size=\"135168\"/E<gt>\n"
380 "E<lt>aspace type=\"mprotect\" size=\"135168\"/E<gt>\n"
381 "E<lt>/heapE<gt>\n"
382 "E<lt>total type=\"fast\" count=\"0\" size=\"0\"/E<gt>\n"
383 "E<lt>total type=\"rest\" count=\"0\" size=\"0\"/E<gt>\n"
384 "E<lt>system type=\"current\" size=\"135168\"/E<gt>\n"
385 "E<lt>system type=\"max\" size=\"135168\"/E<gt>\n"
386 "E<lt>aspace type=\"total\" size=\"135168\"/E<gt>\n"
387 "E<lt>aspace type=\"mprotect\" size=\"135168\"/E<gt>\n"
388 "E<lt>/mallocE<gt>\n"
389 "\\&\n"
390 "============ After allocating blocks ============\n"
391 "E<lt>malloc version=\"1\"E<gt>\n"
392 "E<lt>heap nr=\"0\"E<gt>\n"
393 "E<lt>sizesE<gt>\n"
394 "E<lt>/sizesE<gt>\n"
395 "E<lt>total type=\"fast\" count=\"0\" size=\"0\"/E<gt>\n"
396 "E<lt>total type=\"rest\" count=\"0\" size=\"0\"/E<gt>\n"
397 "E<lt>system type=\"current\" size=\"1081344\"/E<gt>\n"
398 "E<lt>system type=\"max\" size=\"1081344\"/E<gt>\n"
399 "E<lt>aspace type=\"total\" size=\"1081344\"/E<gt>\n"
400 "E<lt>aspace type=\"mprotect\" size=\"1081344\"/E<gt>\n"
401 "E<lt>/heapE<gt>\n"
402 "E<lt>heap nr=\"1\"E<gt>\n"
403 "E<lt>sizesE<gt>\n"
404 "E<lt>/sizesE<gt>\n"
405 "E<lt>total type=\"fast\" count=\"0\" size=\"0\"/E<gt>\n"
406 "E<lt>total type=\"rest\" count=\"0\" size=\"0\"/E<gt>\n"
407 "E<lt>system type=\"current\" size=\"1032192\"/E<gt>\n"
408 "E<lt>system type=\"max\" size=\"1032192\"/E<gt>\n"
409 "E<lt>aspace type=\"total\" size=\"1032192\"/E<gt>\n"
410 "E<lt>aspace type=\"mprotect\" size=\"1032192\"/E<gt>\n"
411 "E<lt>/heapE<gt>\n"
412 "E<lt>total type=\"fast\" count=\"0\" size=\"0\"/E<gt>\n"
413 "E<lt>total type=\"rest\" count=\"0\" size=\"0\"/E<gt>\n"
414 "E<lt>system type=\"current\" size=\"2113536\"/E<gt>\n"
415 "E<lt>system type=\"max\" size=\"2113536\"/E<gt>\n"
416 "E<lt>aspace type=\"total\" size=\"2113536\"/E<gt>\n"
417 "E<lt>aspace type=\"mprotect\" size=\"2113536\"/E<gt>\n"
418 "E<lt>/mallocE<gt>\n"
419 msgstr ""
420 "$ B<getconf GNU_LIBC_VERSION>\n"
421 "glibc 2.13\n"
422 "$ B<./a.out 1 10000 100>\n"
423 "============ Avant allocation des blocs ============\n"
424 "E<lt>malloc version=\"1\"E<gt>\n"
425 "E<lt>heap nr=\"0\"E<gt>\n"
426 "E<lt>sizesE<gt>\n"
427 "E<lt>/sizesE<gt>\n"
428 "E<lt>total type=\"fast\" count=\"0\" size=\"0\"/E<gt>\n"
429 "E<lt>total type=\"rest\" count=\"0\" size=\"0\"/E<gt>\n"
430 "E<lt>system type=\"current\" size=\"135168\"/E<gt>\n"
431 "E<lt>system type=\"max\" size=\"135168\"/E<gt>\n"
432 "E<lt>aspace type=\"total\" size=\"135168\"/E<gt>\n"
433 "E<lt>aspace type=\"mprotect\" size=\"135168\"/E<gt>\n"
434 "E<lt>/heapE<gt>\n"
435 "E<lt>total type=\"fast\" count=\"0\" size=\"0\"/E<gt>\n"
436 "E<lt>total type=\"rest\" count=\"0\" size=\"0\"/E<gt>\n"
437 "E<lt>system type=\"current\" size=\"135168\"/E<gt>\n"
438 "E<lt>system type=\"max\" size=\"135168\"/E<gt>\n"
439 "E<lt>aspace type=\"total\" size=\"135168\"/E<gt>\n"
440 "E<lt>aspace type=\"mprotect\" size=\"135168\"/E<gt>\n"
441 "E<lt>/mallocE<gt>\n"
442 "\\&\n"
443 "============ Après allocation des blocs ============\n"
444 "E<lt>malloc version=\"1\"E<gt>\n"
445 "E<lt>heap nr=\"0\"E<gt>\n"
446 "E<lt>sizesE<gt>\n"
447 "E<lt>/sizesE<gt>\n"
448 "E<lt>total type=\"fast\" count=\"0\" size=\"0\"/E<gt>\n"
449 "E<lt>total type=\"rest\" count=\"0\" size=\"0\"/E<gt>\n"
450 "E<lt>system type=\"current\" size=\"1081344\"/E<gt>\n"
451 "E<lt>system type=\"max\" size=\"1081344\"/E<gt>\n"
452 "E<lt>aspace type=\"total\" size=\"1081344\"/E<gt>\n"
453 "E<lt>aspace type=\"mprotect\" size=\"1081344\"/E<gt>\n"
454 "E<lt>/heapE<gt>\n"
455 "E<lt>heap nr=\"1\"E<gt>\n"
456 "E<lt>sizesE<gt>\n"
457 "E<lt>/sizesE<gt>\n"
458 "E<lt>total type=\"fast\" count=\"0\" size=\"0\"/E<gt>\n"
459 "E<lt>total type=\"rest\" count=\"0\" size=\"0\"/E<gt>\n"
460 "E<lt>system type=\"current\" size=\"1032192\"/E<gt>\n"
461 "E<lt>system type=\"max\" size=\"1032192\"/E<gt>\n"
462 "E<lt>aspace type=\"total\" size=\"1032192\"/E<gt>\n"
463 "E<lt>aspace type=\"mprotect\" size=\"1032192\"/E<gt>\n"
464 "E<lt>/heapE<gt>\n"
465 "E<lt>total type=\"fast\" count=\"0\" size=\"0\"/E<gt>\n"
466 "E<lt>total type=\"rest\" count=\"0\" size=\"0\"/E<gt>\n"
467 "E<lt>system type=\"current\" size=\"2113536\"/E<gt>\n"
468 "E<lt>system type=\"max\" size=\"2113536\"/E<gt>\n"
469 "E<lt>aspace type=\"total\" size=\"2113536\"/E<gt>\n"
470 "E<lt>aspace type=\"mprotect\" size=\"2113536\"/E<gt>\n"
471 "E<lt>/mallocE<gt>\n"
472
473 #. type: SS
474 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
475 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
476 #, no-wrap
477 msgid "Program source"
478 msgstr "Source du programme"
479
480 #. type: Plain text
481 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
482 #: opensuse-tumbleweed
483 #, fuzzy, no-wrap
484 #| msgid ""
485 #| "#include E<lt>err.hE<gt>\n"
486 #| "#include E<lt>errno.hE<gt>\n"
487 #| "#include E<lt>malloc.hE<gt>\n"
488 #| "#include E<lt>pthread.hE<gt>\n"
489 #| "#include E<lt>stdlib.hE<gt>\n"
490 #| "#include E<lt>unistd.hE<gt>\n"
491 #| "\\&\n"
492 #| "static size_t blockSize;\n"
493 #| "static size_t numThreads;\n"
494 #| "static unsigned int numBlocks;\n"
495 #| "\\&\n"
496 #| "static void *\n"
497 #| "thread_func(void *arg)\n"
498 #| "{\n"
499 #| " int tn = (int) arg;\n"
500 #| "\\&\n"
501 #| " /* The multiplier \\[aq](2 + tn)\\[aq] ensures that each thread (including\n"
502 #| " the main thread) allocates a different amount of memory. */\n"
503 #| "\\&\n"
504 #| " for (unsigned int j = 0; j E<lt> numBlocks; j++)\n"
505 #| " if (malloc(blockSize * (2 + tn)) == NULL)\n"
506 #| " err(EXIT_FAILURE, \"malloc-thread\");\n"
507 #| "\\&\n"
508 #| " sleep(100); /* Sleep until main thread terminates. */\n"
509 #| " return NULL;\n"
510 #| "}\n"
511 #| "\\&\n"
512 #| "int\n"
513 #| "main(int argc, char *argv[])\n"
514 #| "{\n"
515 #| " int sleepTime;\n"
516 #| " pthread_t *thr;\n"
517 #| "\\&\n"
518 #| " if (argc E<lt> 4) {\n"
519 #| " fprintf(stderr,\n"
520 #| " \"%s num-threads num-blocks block-size [sleep-time]\\en\",\n"
521 #| " argv[0]);\n"
522 #| " exit(EXIT_FAILURE);\n"
523 #| " }\n"
524 #| "\\&\n"
525 #| " numThreads = atoi(argv[1]);\n"
526 #| " numBlocks = atoi(argv[2]);\n"
527 #| " blockSize = atoi(argv[3]);\n"
528 #| " sleepTime = (argc E<gt> 4) ? atoi(argv[4]) : 0;\n"
529 #| "\\&\n"
530 #| " thr = calloc(numThreads, sizeof(*thr));\n"
531 #| " if (thr == NULL)\n"
532 #| " err(EXIT_FAILURE, \"calloc\");\n"
533 #| "\\&\n"
534 #| " printf(\"============ Before allocating blocks ============\\en\");\n"
535 #| " malloc_info(0, stdout);\n"
536 #| "\\&\n"
537 #| " /* Create threads that allocate different amounts of memory. */\n"
538 #| "\\&\n"
539 #| " for (size_t tn = 0; tn E<lt> numThreads; tn++) {\n"
540 #| " errno = pthread_create(&thr[tn], NULL, thread_func,\n"
541 #| " (void *) tn);\n"
542 #| " if (errno != 0)\n"
543 #| " err(EXIT_FAILURE, \"pthread_create\");\n"
544 #| "\\&\n"
545 #| " /* If we add a sleep interval after the start-up of each\n"
546 #| " thread, the threads likely won\\[aq]t contend for malloc\n"
547 #| " mutexes, and therefore additional arenas won\\[aq]t be\n"
548 #| " allocated (see malloc(3)). */\n"
549 #| "\\&\n"
550 #| " if (sleepTime E<gt> 0)\n"
551 #| " sleep(sleepTime);\n"
552 #| " }\n"
553 #| "\\&\n"
554 #| " /* The main thread also allocates some memory. */\n"
555 #| "\\&\n"
556 #| " for (unsigned int j = 0; j E<lt> numBlocks; j++)\n"
557 #| " if (malloc(blockSize) == NULL)\n"
558 #| " err(EXIT_FAILURE, \"malloc\");\n"
559 #| "\\&\n"
560 #| " sleep(2); /* Give all threads a chance to\n"
561 #| " complete allocations. */\n"
562 #| "\\&\n"
563 #| " printf(\"\\en============ After allocating blocks ============\\en\");\n"
564 #| " malloc_info(0, stdout);\n"
565 #| "\\&\n"
566 #| " exit(EXIT_SUCCESS);\n"
567 #| "}\n"
568 msgid ""
569 "#include E<lt>err.hE<gt>\n"
570 "#include E<lt>errno.hE<gt>\n"
571 "#include E<lt>malloc.hE<gt>\n"
572 "#include E<lt>pthread.hE<gt>\n"
573 "#include E<lt>stdlib.hE<gt>\n"
574 "#include E<lt>unistd.hE<gt>\n"
575 "\\&\n"
576 "static size_t blockSize;\n"
577 "static size_t numThreads;\n"
578 "static unsigned int numBlocks;\n"
579 "\\&\n"
580 "static void *\n"
581 "thread_func(void *arg)\n"
582 "{\n"
583 " int tn = (int) arg;\n"
584 "\\&\n"
585 " /* The multiplier \\[aq](2 + tn)\\[aq] ensures that each thread (including\n"
586 " the main thread) allocates a different amount of memory. */\n"
587 "\\&\n"
588 " for (unsigned int j = 0; j E<lt> numBlocks; j++)\n"
589 " if (malloc(blockSize * (2 + tn)) == NULL)\n"
590 " err(EXIT_FAILURE, \"malloc-thread\");\n"
591 "\\&\n"
592 " sleep(100); /* Sleep until main thread terminates. */\n"
593 " return NULL;\n"
594 "}\n"
595 "\\&\n"
596 "int\n"
597 "main(int argc, char *argv[])\n"
598 "{\n"
599 " int sleepTime;\n"
600 " pthread_t *thr;\n"
601 "\\&\n"
602 " if (argc E<lt> 4) {\n"
603 " fprintf(stderr,\n"
604 " \"%s num-threads num-blocks block-size [sleep-time]\\[rs]n\",\n"
605 " argv[0]);\n"
606 " exit(EXIT_FAILURE);\n"
607 " }\n"
608 "\\&\n"
609 " numThreads = atoi(argv[1]);\n"
610 " numBlocks = atoi(argv[2]);\n"
611 " blockSize = atoi(argv[3]);\n"
612 " sleepTime = (argc E<gt> 4) ? atoi(argv[4]) : 0;\n"
613 "\\&\n"
614 " thr = calloc(numThreads, sizeof(*thr));\n"
615 " if (thr == NULL)\n"
616 " err(EXIT_FAILURE, \"calloc\");\n"
617 "\\&\n"
618 " printf(\"============ Before allocating blocks ============\\[rs]n\");\n"
619 " malloc_info(0, stdout);\n"
620 "\\&\n"
621 " /* Create threads that allocate different amounts of memory. */\n"
622 "\\&\n"
623 " for (size_t tn = 0; tn E<lt> numThreads; tn++) {\n"
624 " errno = pthread_create(&thr[tn], NULL, thread_func,\n"
625 " (void *) tn);\n"
626 " if (errno != 0)\n"
627 " err(EXIT_FAILURE, \"pthread_create\");\n"
628 "\\&\n"
629 " /* If we add a sleep interval after the start-up of each\n"
630 " thread, the threads likely won\\[aq]t contend for malloc\n"
631 " mutexes, and therefore additional arenas won\\[aq]t be\n"
632 " allocated (see malloc(3)). */\n"
633 "\\&\n"
634 " if (sleepTime E<gt> 0)\n"
635 " sleep(sleepTime);\n"
636 " }\n"
637 "\\&\n"
638 " /* The main thread also allocates some memory. */\n"
639 "\\&\n"
640 " for (unsigned int j = 0; j E<lt> numBlocks; j++)\n"
641 " if (malloc(blockSize) == NULL)\n"
642 " err(EXIT_FAILURE, \"malloc\");\n"
643 "\\&\n"
644 " sleep(2); /* Give all threads a chance to\n"
645 " complete allocations. */\n"
646 "\\&\n"
647 " printf(\"\\[rs]n============ After allocating blocks ============\\[rs]n\");\n"
648 " malloc_info(0, stdout);\n"
649 "\\&\n"
650 " exit(EXIT_SUCCESS);\n"
651 "}\n"
652 msgstr ""
653 "#include E<lt>err.hE<gt>\n"
654 "#include E<lt>errno.hE<gt>\n"
655 "#include E<lt>malloc.hE<gt>\n"
656 "#include E<lt>pthread.hE<gt>\n"
657 "#include E<lt>stdlib.hE<gt>\n"
658 "#include E<lt>unistd.hE<gt>\n"
659 "\\&\n"
660 "static size_t tailleBloc;\n"
661 "static size_t numThreads;\n"
662 "static unsigned int numBlocks;\n"
663 "\\&\n"
664 "static void *\n"
665 "thread_func(void *arg)\n"
666 "{\n"
667 " int tn = (int) arg;\n"
668 "\\&\n"
669 " /* Le multiplicateur \\[aq](2 + tn)\\[aq] assure que chaque thread (dont\n"
670 " le thread principal) alloue une quantité de mémoire différente. */\n"
671 "\\&\n"
672 " for (unsigned int j = 0; j E<lt> numBlocks; j++)\n"
673 " if (malloc(blockSize * (2 + tn)) == NULL)\n"
674 " err(EXIT_FAILURE, \"malloc-thread\");\n"
675 "\\&\n"
676 " sleep(100); /* Attendre que le thread principal se termine. */\n"
677 " return NULL;\n"
678 "}\n"
679 "\\&\n"
680 "int\n"
681 "main(int argc, char *argv[])\n"
682 "{\n"
683 " int sleepTime;\n"
684 " pthread_t *thr;\n"
685 "\\&\n"
686 " if (argc E<lt> 4) {\n"
687 " fprintf(stderr,\n"
688 " \"%s nb-threads nb-blocs taille-bloc [tps-sommeil]\\en\",\n"
689 " argv[0]);\n"
690 " exit(EXIT_FAILURE);\n"
691 " }\n"
692 "\\&\n"
693 " numThreads = atoi(argv[1]);\n"
694 " numBlocks = atoi(argv[2]);\n"
695 " blockSize = atoi(argv[3]);\n"
696 " sleepTime = (argc E<gt> 4) ? atoi(argv[4]) : 0;\n"
697 "\\&\n"
698 " thr = calloc(numThreads, sizeof(*thr));\n"
699 " if (thr == NULL)\n"
700 " err(EXIT_FAILURE, \"calloc\");\n"
701 "\\&\n"
702 " printf(\"============ Avant allocation des blocs ============\\en\");\n"
703 " malloc_info(0, stdout);\n"
704 "\\&\n"
705 " /* Créer les threads allouant des quantités de mémoire différentes. */\n"
706 "\\&\n"
707 " for (size_t tn = 0; tn E<lt> numThreads; tn++) {\n"
708 " errno = pthread_create(&thr[tn], NULL, thread_func,\n"
709 " (void *) tn);\n"
710 " if (errno != 0)\n"
711 " err(EXIT_FAILURE, \"pthread_create\");\n"
712 "\\&\n"
713 " /* Si un intervalle de sommeil existe après le démarrage de\n"
714 " chaque thread, les threads ne vont sans doute pas se battre\n"
715 " pour les mutex malloc et par conséquent les domaines de mémoire\n"
716 " supplémentaires ne seront pas alloués (consultez malloc(3)).\n"
717 " */\n"
718 "\\&\n"
719 " if (sleepTime E<gt> 0)\n"
720 " sleep(sleepTime);\n"
721 " }\n"
722 "\\&\n"
723 " /* Le thread principal alloue également de la mémoire. */\n"
724 "\\&\n"
725 " for (unsigned int j = 0; j E<lt> numBlocks; j++)\n"
726 " if (malloc(blockSize) == NULL)\n"
727 " err(EXIT_FAILURE, \"malloc\");\n"
728 "\\&\n"
729 " sleep(2); /* Donner à tous les threads une chance\n"
730 " de terminer les allocations. */\n"
731 "\\&\n"
732 " printf(\"\\en============ Après allocation des blocs ============\\en\");\n"
733 " malloc_info(0, stdout);\n"
734 "\\&\n"
735 " exit(EXIT_SUCCESS);\n"
736 "}\n"
737
738 #. SRC END
739 #. type: SH
740 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
741 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
742 #, no-wrap
743 msgid "SEE ALSO"
744 msgstr "VOIR AUSSI"
745
746 #. type: Plain text
747 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
748 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
749 msgid ""
750 "B<mallinfo>(3), B<malloc>(3), B<malloc_stats>(3), B<mallopt>(3), "
751 "B<open_memstream>(3)"
752 msgstr ""
753 "B<mallinfo>(3), B<malloc>(3), B<malloc_stats>(3), B<mallopt>(3), "
754 "B<open_memstream>(3)"
755
756 #. type: TH
757 #: debian-trixie
758 #, no-wrap
759 msgid "2024-06-15"
760 msgstr "15 juin 2024"
761
762 #. type: TH
763 #: debian-trixie
764 #, no-wrap
765 msgid "Linux man-pages 6.9.1"
766 msgstr "Pages du manuel de Linux 6.9.1"
767
768 #. type: Plain text
769 #: debian-trixie
770 msgid "Standard C library (I<libc>, I<-lc>)"
771 msgstr "Bibliothèque C standard (I<libc>, I<-lc>)"
772
773 #. type: Plain text
774 #: debian-trixie fedora-44 fedora-rawhide
775 #, fuzzy, no-wrap
776 #| msgid ""
777 #| "#include E<lt>err.hE<gt>\n"
778 #| "#include E<lt>errno.hE<gt>\n"
779 #| "#include E<lt>malloc.hE<gt>\n"
780 #| "#include E<lt>pthread.hE<gt>\n"
781 #| "#include E<lt>stdlib.hE<gt>\n"
782 #| "#include E<lt>unistd.hE<gt>\n"
783 #| "\\&\n"
784 #| "static size_t blockSize;\n"
785 #| "static size_t numThreads;\n"
786 #| "static unsigned int numBlocks;\n"
787 #| "\\&\n"
788 #| "static void *\n"
789 #| "thread_func(void *arg)\n"
790 #| "{\n"
791 #| " int tn = (int) arg;\n"
792 #| "\\&\n"
793 #| " /* The multiplier \\[aq](2 + tn)\\[aq] ensures that each thread (including\n"
794 #| " the main thread) allocates a different amount of memory. */\n"
795 #| "\\&\n"
796 #| " for (unsigned int j = 0; j E<lt> numBlocks; j++)\n"
797 #| " if (malloc(blockSize * (2 + tn)) == NULL)\n"
798 #| " err(EXIT_FAILURE, \"malloc-thread\");\n"
799 #| "\\&\n"
800 #| " sleep(100); /* Sleep until main thread terminates. */\n"
801 #| " return NULL;\n"
802 #| "}\n"
803 #| "\\&\n"
804 #| "int\n"
805 #| "main(int argc, char *argv[])\n"
806 #| "{\n"
807 #| " int sleepTime;\n"
808 #| " pthread_t *thr;\n"
809 #| "\\&\n"
810 #| " if (argc E<lt> 4) {\n"
811 #| " fprintf(stderr,\n"
812 #| " \"%s num-threads num-blocks block-size [sleep-time]\\en\",\n"
813 #| " argv[0]);\n"
814 #| " exit(EXIT_FAILURE);\n"
815 #| " }\n"
816 #| "\\&\n"
817 #| " numThreads = atoi(argv[1]);\n"
818 #| " numBlocks = atoi(argv[2]);\n"
819 #| " blockSize = atoi(argv[3]);\n"
820 #| " sleepTime = (argc E<gt> 4) ? atoi(argv[4]) : 0;\n"
821 #| "\\&\n"
822 #| " thr = calloc(numThreads, sizeof(*thr));\n"
823 #| " if (thr == NULL)\n"
824 #| " err(EXIT_FAILURE, \"calloc\");\n"
825 #| "\\&\n"
826 #| " printf(\"============ Before allocating blocks ============\\en\");\n"
827 #| " malloc_info(0, stdout);\n"
828 #| "\\&\n"
829 #| " /* Create threads that allocate different amounts of memory. */\n"
830 #| "\\&\n"
831 #| " for (size_t tn = 0; tn E<lt> numThreads; tn++) {\n"
832 #| " errno = pthread_create(&thr[tn], NULL, thread_func,\n"
833 #| " (void *) tn);\n"
834 #| " if (errno != 0)\n"
835 #| " err(EXIT_FAILURE, \"pthread_create\");\n"
836 #| "\\&\n"
837 #| " /* If we add a sleep interval after the start-up of each\n"
838 #| " thread, the threads likely won\\[aq]t contend for malloc\n"
839 #| " mutexes, and therefore additional arenas won\\[aq]t be\n"
840 #| " allocated (see malloc(3)). */\n"
841 #| "\\&\n"
842 #| " if (sleepTime E<gt> 0)\n"
843 #| " sleep(sleepTime);\n"
844 #| " }\n"
845 #| "\\&\n"
846 #| " /* The main thread also allocates some memory. */\n"
847 #| "\\&\n"
848 #| " for (unsigned int j = 0; j E<lt> numBlocks; j++)\n"
849 #| " if (malloc(blockSize) == NULL)\n"
850 #| " err(EXIT_FAILURE, \"malloc\");\n"
851 #| "\\&\n"
852 #| " sleep(2); /* Give all threads a chance to\n"
853 #| " complete allocations. */\n"
854 #| "\\&\n"
855 #| " printf(\"\\en============ After allocating blocks ============\\en\");\n"
856 #| " malloc_info(0, stdout);\n"
857 #| "\\&\n"
858 #| " exit(EXIT_SUCCESS);\n"
859 #| "}\n"
860 msgid ""
861 "#include E<lt>err.hE<gt>\n"
862 "#include E<lt>errno.hE<gt>\n"
863 "#include E<lt>malloc.hE<gt>\n"
864 "#include E<lt>pthread.hE<gt>\n"
865 "#include E<lt>stdlib.hE<gt>\n"
866 "#include E<lt>unistd.hE<gt>\n"
867 "\\&\n"
868 "static size_t blockSize;\n"
869 "static size_t numThreads;\n"
870 "static unsigned int numBlocks;\n"
871 "\\&\n"
872 "static void *\n"
873 "thread_func(void *arg)\n"
874 "{\n"
875 " int tn = (int) arg;\n"
876 "\\&\n"
877 " /* The multiplier \\[aq](2 + tn)\\[aq] ensures that each thread (including\n"
878 " the main thread) allocates a different amount of memory. */\n"
879 "\\&\n"
880 " for (unsigned int j = 0; j E<lt> numBlocks; j++)\n"
881 " if (malloc(blockSize * (2 + tn)) == NULL)\n"
882 " err(EXIT_FAILURE, \"malloc-thread\");\n"
883 "\\&\n"
884 " sleep(100); /* Sleep until main thread terminates. */\n"
885 " return NULL;\n"
886 "}\n"
887 "\\&\n"
888 "int\n"
889 "main(int argc, char *argv[])\n"
890 "{\n"
891 " int sleepTime;\n"
892 " pthread_t *thr;\n"
893 "\\&\n"
894 " if (argc E<lt> 4) {\n"
895 " fprintf(stderr,\n"
896 " \"%s num-threads num-blocks block-size [sleep-time]\\[rs]n\",\n"
897 " argv[0]);\n"
898 " exit(EXIT_FAILURE);\n"
899 " }\n"
900 "\\&\n"
901 " numThreads = atoi(argv[1]);\n"
902 " numBlocks = atoi(argv[2]);\n"
903 " blockSize = atoi(argv[3]);\n"
904 " sleepTime = (argc E<gt> 4) ? atoi(argv[4]) : 0;\n"
905 "\\&\n"
906 " thr = calloc(numThreads, sizeof(*thr));\n"
907 " if (thr == NULL)\n"
908 " err(EXIT_FAILURE, \"calloc\");\n"
909 "\\&\n"
910 " printf(\"============ Before allocating blocks ============\\[rs]n\");\n"
911 " malloc_info(0, stdout);\n"
912 "\\&\n"
913 " /* Create threads that allocate different amounts of memory. */\n"
914 "\\&\n"
915 " for (size_t tn = 0; tn E<lt> numThreads; tn++) {\n"
916 " errno = pthread_create(&thr[tn], NULL, thread_func,\n"
917 " (void *) tn);\n"
918 " if (errno != 0)\n"
919 " err(EXIT_FAILURE, \"pthread_create\");\n"
920 "\\&\n"
921 " /* If we add a sleep interval after the start-up of each\n"
922 " thread, the threads likely won\\[aq]t contend for malloc\n"
923 " mutexes, and therefore additional arenas won\\[aq]t be\n"
924 " allocated (see malloc(3)). */\n"
925 "\\&\n"
926 " if (sleepTime E<gt> 0)\n"
927 " sleep(sleepTime);\n"
928 " }\n"
929 "\\&\n"
930 " /* The main thread also allocates some memory. */\n"
931 "\\&\n"
932 " for (unsigned int j = 0; j E<lt> numBlocks; j++)\n"
933 " if (malloc(blockSize) == NULL)\n"
934 " err(EXIT_FAILURE, \"malloc\");\n"
935 "\\&\n"
936 " sleep(2); /* Give all threads a chance to\n"
937 " complete allocations. */\n"
938 "\\&\n"
939 " printf(\"\\[rs]n============ After allocating blocks ============\\[rs]n\");\n"
940 " malloc_info(0, stdout);\n"
941 "\\&\n"
942 " exit(EXIT_SUCCESS);\n"
943 "}\n"
944 msgstr ""
945 "#include E<lt>err.hE<gt>\n"
946 "#include E<lt>errno.hE<gt>\n"
947 "#include E<lt>malloc.hE<gt>\n"
948 "#include E<lt>pthread.hE<gt>\n"
949 "#include E<lt>stdlib.hE<gt>\n"
950 "#include E<lt>unistd.hE<gt>\n"
951 "\\&\n"
952 "static size_t tailleBloc;\n"
953 "static size_t numThreads;\n"
954 "static unsigned int numBlocks;\n"
955 "\\&\n"
956 "static void *\n"
957 "thread_func(void *arg)\n"
958 "{\n"
959 " int tn = (int) arg;\n"
960 "\\&\n"
961 " /* Le multiplicateur \\[aq](2 + tn)\\[aq] assure que chaque thread (dont\n"
962 " le thread principal) alloue une quantité de mémoire différente. */\n"
963 "\\&\n"
964 " for (unsigned int j = 0; j E<lt> numBlocks; j++)\n"
965 " if (malloc(blockSize * (2 + tn)) == NULL)\n"
966 " err(EXIT_FAILURE, \"malloc-thread\");\n"
967 "\\&\n"
968 " sleep(100); /* Attendre que le thread principal se termine. */\n"
969 " return NULL;\n"
970 "}\n"
971 "\\&\n"
972 "int\n"
973 "main(int argc, char *argv[])\n"
974 "{\n"
975 " int sleepTime;\n"
976 " pthread_t *thr;\n"
977 "\\&\n"
978 " if (argc E<lt> 4) {\n"
979 " fprintf(stderr,\n"
980 " \"%s nb-threads nb-blocs taille-bloc [tps-sommeil]\\en\",\n"
981 " argv[0]);\n"
982 " exit(EXIT_FAILURE);\n"
983 " }\n"
984 "\\&\n"
985 " numThreads = atoi(argv[1]);\n"
986 " numBlocks = atoi(argv[2]);\n"
987 " blockSize = atoi(argv[3]);\n"
988 " sleepTime = (argc E<gt> 4) ? atoi(argv[4]) : 0;\n"
989 "\\&\n"
990 " thr = calloc(numThreads, sizeof(*thr));\n"
991 " if (thr == NULL)\n"
992 " err(EXIT_FAILURE, \"calloc\");\n"
993 "\\&\n"
994 " printf(\"============ Avant allocation des blocs ============\\en\");\n"
995 " malloc_info(0, stdout);\n"
996 "\\&\n"
997 " /* Créer les threads allouant des quantités de mémoire différentes. */\n"
998 "\\&\n"
999 " for (size_t tn = 0; tn E<lt> numThreads; tn++) {\n"
1000 " errno = pthread_create(&thr[tn], NULL, thread_func,\n"
1001 " (void *) tn);\n"
1002 " if (errno != 0)\n"
1003 " err(EXIT_FAILURE, \"pthread_create\");\n"
1004 "\\&\n"
1005 " /* Si un intervalle de sommeil existe après le démarrage de\n"
1006 " chaque thread, les threads ne vont sans doute pas se battre\n"
1007 " pour les mutex malloc et par conséquent les domaines de mémoire\n"
1008 " supplémentaires ne seront pas alloués (consultez malloc(3)).\n"
1009 " */\n"
1010 "\\&\n"
1011 " if (sleepTime E<gt> 0)\n"
1012 " sleep(sleepTime);\n"
1013 " }\n"
1014 "\\&\n"
1015 " /* Le thread principal alloue également de la mémoire. */\n"
1016 "\\&\n"
1017 " for (unsigned int j = 0; j E<lt> numBlocks; j++)\n"
1018 " if (malloc(blockSize) == NULL)\n"
1019 " err(EXIT_FAILURE, \"malloc\");\n"
1020 "\\&\n"
1021 " sleep(2); /* Donner à tous les threads une chance\n"
1022 " de terminer les allocations. */\n"
1023 "\\&\n"
1024 " printf(\"\\en============ Après allocation des blocs ============\\en\");\n"
1025 " malloc_info(0, stdout);\n"
1026 "\\&\n"
1027 " exit(EXIT_SUCCESS);\n"
1028 "}\n"
1029
1030 #. type: TH
1031 #: fedora-44 fedora-rawhide
1032 #, no-wrap
1033 msgid "2024-07-23"
1034 msgstr "23 juillet 2024"
1035
1036 #. type: TH
1037 #: fedora-44 fedora-rawhide
1038 #, no-wrap
1039 msgid "Linux man-pages 6.13"
1040 msgstr "Pages du manuel de Linux 6.13"
1041
1042 #. type: TH
1043 #: mageia-cauldron
1044 #, no-wrap
1045 msgid "Linux man-pages 6.17"
1046 msgstr "Pages du manuel de Linux 6.17"
1047
1048 #. type: TH
1049 #: opensuse-leap-16-1 opensuse-tumbleweed
1050 #, no-wrap
1051 msgid "Linux man-pages (unreleased)"
1052 msgstr "Pages du manuel de Linux (non publiées)"