Debian Codegraph @

po/es/man3/malloc.3.po

raw
1 # Spanish translation of manpages
2 # This file is distributed under the same license as the manpages-l10n package.
3 # Copyright © of this file:
4 # Vicente Pastor Gómez <[email protected]>, 1998.
5 # Juan Piernas <[email protected]>, 1998.
6 # Miguel Pérez Ibars <[email protected]>, 2005.
7 msgid ""
8 msgstr ""
9 "Project-Id-Version: manpages-l10n\n"
10 "POT-Creation-Date: 2026-06-05 06:30+0200\n"
11 "PO-Revision-Date: 2005-03-29 19:53+0200\n"
12 "Last-Translator: Miguel Pérez Ibars <[email protected]>\n"
13 "Language-Team: Spanish <[email protected]>\n"
14 "Language: es\n"
15 "MIME-Version: 1.0\n"
16 "Content-Type: text/plain; charset=UTF-8\n"
17 "Content-Transfer-Encoding: 8bit\n"
18 "Plural-Forms: nplurals=2; plural=(n != 1);\n"
19 "X-Generator: Lokalize 20.04.1\n"
20
21 #. type: TH
22 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
23 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
24 #, fuzzy, no-wrap
25 #| msgid "B<reallocarray>():"
26 msgid "malloc"
27 msgstr "B<reallocarray>():"
28
29 #. type: TH
30 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
31 #: opensuse-tumbleweed
32 #, no-wrap
33 msgid "2026-02-08"
34 msgstr "8 Febrero 2026"
35
36 #. type: TH
37 #: archlinux debian-unstable
38 #, fuzzy, no-wrap
39 #| msgid "Linux man-pages 6.17"
40 msgid "Linux man-pages 6.18"
41 msgstr "Páginas de Manual de Linux 6.17"
42
43 #. type: SH
44 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
45 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
46 #, no-wrap
47 msgid "NAME"
48 msgstr "NOMBRE"
49
50 #. type: Plain text
51 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
52 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
53 msgid ""
54 "malloc, free, calloc, realloc, reallocarray - allocate and free dynamic "
55 "memory"
56 msgstr ""
57 "malloc, free, calloc, realloc, reallocarray - asignar y liberar memoria "
58 "dinámica"
59
60 #. type: SH
61 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
62 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
63 #, no-wrap
64 msgid "LIBRARY"
65 msgstr "BIBLIOTECA"
66
67 #. type: Plain text
68 #: archlinux debian-unstable fedora-44 fedora-rawhide mageia-cauldron
69 #: opensuse-leap-16-1 opensuse-tumbleweed
70 msgid "Standard C library (I<libc>,\\ I<-lc>)"
71 msgstr "Biblioteca Estándar C (I<libc>,\\ I<-lc>)"
72
73 #. type: SH
74 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
75 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
76 #, no-wrap
77 msgid "SYNOPSIS"
78 msgstr "SINOPSIS"
79
80 #. type: Plain text
81 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
82 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
83 #, no-wrap
84 msgid "B<#include E<lt>stdlib.hE<gt>>\n"
85 msgstr "B<#include E<lt>stdlib.hE<gt>>\n"
86
87 #. type: Plain text
88 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
89 #: opensuse-tumbleweed
90 #, fuzzy, no-wrap
91 #| msgid ""
92 #| "B<void *malloc(size_t >I<size>B<);>\n"
93 #| "B<void free(void >I<*ptr>B<);>\n"
94 #| "B<void *calloc(size_t >I<nmemb>B<, size_t >I<size>B<);>\n"
95 #| "B<void *realloc(void >I<*ptr>B<, size_t >I<size>B<);>\n"
96 #| "B<void *reallocarray(void >I<*ptr>B<, size_t >I<nmemb>B<, size_t >I<size>B<);>\n"
97 msgid ""
98 "B<void *malloc(size_t >I<size>B<);>\n"
99 "B<void free(void *_Nullable >I<p>B<);>\n"
100 "B<void *calloc(size_t >I<n>B<, size_t >I<size>B<);>\n"
101 "B<void *realloc(void *_Nullable >I<p>B<, size_t >I<size>B<);>\n"
102 "B<void *reallocarray(void *_Nullable >I<p>B<, size_t >I<n>B<, size_t >I<size>B<);>\n"
103 msgstr ""
104 "B<void *malloc(size_t >I<size>B<);>\n"
105 "B<void free(void >I<*ptr>B<);>\n"
106 "B<void *calloc(size_t >I<nmemb>B<, size_t >I<size>B<);>\n"
107 "B<void *realloc(void >I<*ptr>B<, size_t >I<size>B<);>\n"
108 "B<void *reallocarray(void >I<*ptr>B<, size_t >I<nmemb>B<, size_t >I<size>B<);>\n"
109
110 #. type: Plain text
111 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
112 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
113 msgid ""
114 "Feature Test Macro Requirements for glibc (see B<feature_test_macros>(7)):"
115 msgstr ""
116 "Requisitos de Macros de Prueba de Características para glibc (véase "
117 "B<feature_test_macros>(7)):"
118
119 #. type: Plain text
120 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
121 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
122 msgid "B<reallocarray>():"
123 msgstr "B<reallocarray>():"
124
125 #. type: Plain text
126 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
127 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
128 #, fuzzy, no-wrap
129 #| msgid ""
130 #| " /* Since glibc 2.19: */ _DEFAULT_SOURCE\n"
131 #| " || /* Glibc E<lt>= 2.19: */ _BSD_SOURCE || _SVID_SOURCE\n"
132 msgid ""
133 " Since glibc 2.29:\n"
134 " _DEFAULT_SOURCE\n"
135 " glibc 2.28 and earlier:\n"
136 " _GNU_SOURCE\n"
137 msgstr ""
138 " /* Desde glibc 2.19: */ _DEFAULT_SOURCE\n"
139 " || /* Glibc E<lt>= 2.19: */ _BSD_SOURCE || _SVID_SOURCE\n"
140
141 #. type: SH
142 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
143 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
144 #, no-wrap
145 msgid "DESCRIPTION"
146 msgstr "DESCRIPCIÓN"
147
148 #. type: SS
149 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
150 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
151 #, no-wrap
152 msgid "malloc()"
153 msgstr ""
154
155 #. type: Plain text
156 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
157 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
158 msgid ""
159 "The B<malloc>() function allocates I<size> bytes and returns a pointer to "
160 "the allocated memory. I<The memory is not initialized>. If I<size> is 0, "
161 "then B<malloc>() returns a unique pointer value that can later be "
162 "successfully passed to B<free>(). (See \"Nonportable behavior\" for "
163 "portability issues.)"
164 msgstr ""
165
166 #. type: SS
167 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
168 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
169 #, no-wrap
170 msgid "free()"
171 msgstr ""
172
173 #. type: Plain text
174 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
175 #: opensuse-tumbleweed
176 #, fuzzy
177 #| msgid ""
178 #| "The B<free>() function frees the memory space pointed to by I<ptr>, "
179 #| "which must have been returned by a previous call to B<malloc>(), "
180 #| "B<calloc>(), or B<realloc>(). Otherwise, or if I<free(ptr)> has already "
181 #| "been called before, undefined behavior occurs. If I<ptr> is NULL, no "
182 #| "operation is performed."
183 msgid ""
184 "The B<free>() function frees the memory space pointed to by I<p>, which "
185 "must have been returned by a previous call to B<malloc>() or related "
186 "functions. Otherwise, or if I<p> has already been freed, undefined behavior "
187 "occurs. If I<p> is NULL, no operation is performed."
188 msgstr ""
189 "B<free>() libera el espacio de memoria apuntado por I<ptr>, que debe haber "
190 "sido devuelto por una llamada previa a B<malloc>(), B<calloc>() o "
191 "B<realloc>(). En caso contrario, o si B<free(ptr)> ya se ha llamado antes, "
192 "se produce un comportamiento indefinido. Si I<ptr> es NULL, no se realiza "
193 "ninguna operación."
194
195 #. type: SS
196 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
197 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
198 #, no-wrap
199 msgid "calloc()"
200 msgstr ""
201
202 #. type: Plain text
203 #: archlinux debian-unstable fedora-44 fedora-rawhide mageia-cauldron
204 #: opensuse-leap-16-1 opensuse-tumbleweed
205 msgid ""
206 "The B<calloc>() function allocates memory for an array of I<n> elements of "
207 "I<size> bytes each and returns a pointer to the allocated memory. The "
208 "memory is set to zero. If I<n> or I<size> is 0, then B<calloc>() returns a "
209 "unique pointer value that can later be successfully passed to B<free>()."
210 msgstr ""
211
212 #. type: Plain text
213 #: archlinux debian-unstable fedora-44 fedora-rawhide mageia-cauldron
214 #: opensuse-leap-16-1 opensuse-tumbleweed
215 msgid ""
216 "If the multiplication of I<n> and I<size> would result in integer overflow, "
217 "then B<calloc>() returns an error. By contrast, an integer overflow would "
218 "not be detected in the following call to B<malloc>(), with the result that "
219 "an incorrectly sized block of memory would be allocated:"
220 msgstr ""
221
222 #. type: Plain text
223 #: archlinux debian-unstable fedora-44 fedora-rawhide mageia-cauldron
224 #: opensuse-leap-16-1 opensuse-tumbleweed
225 #, fuzzy, no-wrap
226 #| msgid "malloc(nmemb * size);\n"
227 msgid "malloc(n * size);\n"
228 msgstr "malloc(nmemb * size);\n"
229
230 #. type: SS
231 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
232 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
233 #, fuzzy, no-wrap
234 #| msgid "B<reallocarray>():"
235 msgid "realloc()"
236 msgstr "B<reallocarray>():"
237
238 #. type: Plain text
239 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
240 #: opensuse-tumbleweed
241 #, fuzzy
242 #| msgid ""
243 #| "B<realloc()> changes the size of the memory block pointed to by I<ptr> to "
244 #| "I<size> bytes. The contents will be unchanged to the minimum of the old "
245 #| "and new sizes; newly allocated memory will be uninitialized. If I<ptr> "
246 #| "is B<NULL>, the call is equivalent to B<malloc(size)>; if size is equal "
247 #| "to zero, the call is equivalent to B<free(>I<ptr>B<)>I<.> Unless I<ptr> "
248 #| "is B<NULL>, it must have been returned by an earlier call to B<malloc()>, "
249 #| "B<calloc()> or B<realloc()>."
250 msgid ""
251 "The B<realloc>() function changes the size of the memory block pointed to "
252 "by I<p> to I<size> bytes. The contents of the memory will be unchanged in "
253 "the range from the start of the region up to the minimum of the old and new "
254 "sizes. If the new size is larger than the old size, the added memory will "
255 "I<not> be initialized."
256 msgstr ""
257 "B<realloc()> cambia el tamaño del bloque de memoria apuntado por I<ptr> a "
258 "I<size> bytes. El contenido permanecerá inalterado hasta el mínimo entre el "
259 "tamaño viejo y el nuevo; la memoria recién asignada quedará sin "
260 "inicializar. Si I<ptr> es B<NULL>, la llamada es equivalente a "
261 "B<malloc(size)>; si size es igual a cero, la llamada es equivalente a "
262 "B<free(>I<ptr>B<)>I<.> I<ptr> debe haber sido devuelto por una llamada "
263 "previa a B<malloc()>, B<calloc()> o B<realloc()>, a menos que I<ptr> sea "
264 "B<NULL>."
265
266 #. type: Plain text
267 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
268 #: opensuse-tumbleweed
269 msgid ""
270 "If I<p> is NULL, then the call is equivalent to I<malloc(size)>, for all "
271 "values of I<size>."
272 msgstr ""
273
274 #. type: Plain text
275 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
276 #: opensuse-tumbleweed
277 msgid ""
278 "If I<size> is equal to zero, and I<p> is not NULL, then the call is "
279 "equivalent to I<free(p)> (but see \"Nonportable behavior\" for portability "
280 "issues)."
281 msgstr ""
282
283 #. type: Plain text
284 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
285 #: opensuse-tumbleweed
286 msgid ""
287 "Unless I<p> is NULL, it must have been returned by an earlier call to "
288 "B<malloc> or related functions. If the area pointed to was moved, a "
289 "I<free(p)> is done."
290 msgstr ""
291
292 #. type: SS
293 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
294 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
295 #, fuzzy, no-wrap
296 #| msgid "B<reallocarray>():"
297 msgid "reallocarray()"
298 msgstr "B<reallocarray>():"
299
300 #. type: Plain text
301 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
302 #: opensuse-tumbleweed
303 msgid ""
304 "The B<reallocarray>() function changes the size of (and possibly moves) "
305 "the memory block pointed to by I<p> to be large enough for an array of I<n> "
306 "elements, each of which is I<size> bytes. It is equivalent to the call"
307 msgstr ""
308
309 #. type: Plain text
310 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
311 #: opensuse-tumbleweed
312 #, fuzzy, no-wrap
313 #| msgid " realloc(ptr, nmemb * size);\n"
314 msgid "realloc(p, n * size);\n"
315 msgstr " realloc(ptr, nmemb * size);\n"
316
317 #. type: Plain text
318 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
319 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
320 msgid ""
321 "However, unlike that B<realloc>() call, B<reallocarray>() fails safely in "
322 "the case where the multiplication would overflow. If such an overflow "
323 "occurs, B<reallocarray>() returns an error."
324 msgstr ""
325
326 #. type: SH
327 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
328 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
329 #, no-wrap
330 msgid "RETURN VALUE"
331 msgstr "VALOR DEVUELTO"
332
333 #. type: Plain text
334 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
335 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
336 msgid ""
337 "The B<malloc>(), B<calloc>(), B<realloc>(), and B<reallocarray>() functions "
338 "return a pointer to the allocated memory, which is suitably aligned for any "
339 "type that fits into the requested size or less. On error, these functions "
340 "return NULL and set I<errno>. Attempting to allocate more than "
341 "B<PTRDIFF_MAX> bytes is considered an error, as an object that large could "
342 "cause later pointer subtraction to overflow."
343 msgstr ""
344
345 #. type: Plain text
346 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
347 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
348 #, fuzzy
349 #| msgid "B<free()> returns no value."
350 msgid "The B<free>() function returns no value, and preserves I<errno>."
351 msgstr "B<free()> no devuelve ningún valor."
352
353 #. type: Plain text
354 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
355 #: opensuse-tumbleweed
356 #, fuzzy
357 #| msgid ""
358 #| "B<realloc()> returns a pointer to the newly allocated memory, which is "
359 #| "suitably aligned for any kind of variable and may be different from "
360 #| "I<ptr>, or B<NULL> if the request fails. If I<size> was equal to 0, "
361 #| "either NULL or a pointer suitable to be passed to I<free>() is "
362 #| "returned. If B<realloc()> fails the original block is left untouched - "
363 #| "it is not freed or moved."
364 msgid ""
365 "The B<realloc>() and B<reallocarray>() functions return NULL if I<p> is "
366 "not NULL and the requested size is zero; this is not considered an error. "
367 "(See \"Nonportable behavior\" for portability issues.) Otherwise, the "
368 "returned pointer may be the same as I<p> if the allocation was not moved "
369 "(e.g., there was room to expand the allocation in-place), or different from "
370 "I<p> if the allocation was moved to a new address. If these functions fail, "
371 "the original block is left untouched; it is not freed or moved."
372 msgstr ""
373 "B<realloc()> devuelve un puntero a la memoria recién asignada, que está "
374 "convenientemente preparada para cualquier tipo de variable y podría ser "
375 "diferente de I<ptr>, o B<NULL> si la petición falla. Si I<size> es igual a "
376 "0, se devuelve o bien NULL o bien un puntero susceptible de ser pasado a "
377 "I<free>().I<Si> B<realloc()> falla el bloque original se queda como estaba - "
378 "no es liberado ni movido."
379
380 #. type: SH
381 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
382 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
383 #, no-wrap
384 msgid "ERRORS"
385 msgstr "ERRORES"
386
387 #. type: Plain text
388 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
389 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
390 msgid ""
391 "B<calloc>(), B<malloc>(), B<realloc>(), and B<reallocarray>() can fail with "
392 "the following error:"
393 msgstr ""
394
395 #. type: TP
396 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
397 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
398 #, no-wrap
399 msgid "B<ENOMEM>"
400 msgstr "B<ENOMEM>"
401
402 #. type: Plain text
403 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
404 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
405 msgid ""
406 "Out of memory. Possibly, the application hit the B<RLIMIT_AS> or "
407 "B<RLIMIT_DATA> limit described in B<getrlimit>(2). Another reason could be "
408 "that the number of mappings created by the caller process exceeded the limit "
409 "specified by I</proc/sys/vm/max_map_count>."
410 msgstr ""
411
412 #. type: SH
413 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
414 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
415 #, no-wrap
416 msgid "ATTRIBUTES"
417 msgstr "ATRIBUTOS"
418
419 #. type: Plain text
420 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
421 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
422 msgid ""
423 "For an explanation of the terms used in this section, see B<attributes>(7)."
424 msgstr ""
425 "Para obtener una explicación de los términos usados en esta sección, véase "
426 "B<attributes>(7)."
427
428 #. type: tbl table
429 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
430 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
431 #, no-wrap
432 msgid "Interface"
433 msgstr "Interfaz"
434
435 #. type: tbl table
436 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
437 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
438 #, no-wrap
439 msgid "Attribute"
440 msgstr "Atributo"
441
442 #. type: tbl table
443 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
444 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
445 #, no-wrap
446 msgid "Value"
447 msgstr "Valor"
448
449 #. type: tbl table
450 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
451 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
452 #, no-wrap
453 msgid ".na\n"
454 msgstr ".na\n"
455
456 #. type: tbl table
457 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
458 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
459 #, no-wrap
460 msgid ".nh\n"
461 msgstr ".nh\n"
462
463 #. type: tbl table
464 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
465 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
466 #, fuzzy, no-wrap
467 #| msgid ""
468 #| "B<calloc>(),\n"
469 #| "B<realloc>()"
470 msgid ""
471 "B<malloc>(),\n"
472 "B<free>(),\n"
473 "B<calloc>(),\n"
474 "B<realloc>()"
475 msgstr ""
476 "B<calloc>(),\n"
477 "B<realloc>()"
478
479 #. type: tbl table
480 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
481 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
482 #, no-wrap
483 msgid "Thread safety"
484 msgstr "Seguridad del hilo"
485
486 #. type: tbl table
487 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
488 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
489 #, no-wrap
490 msgid "MT-Safe"
491 msgstr "Multi-hilo seguro"
492
493 #. type: SH
494 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
495 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
496 #, no-wrap
497 msgid "STANDARDS"
498 msgstr "ESTÁNDARES"
499
500 #. type: TP
501 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
502 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
503 #, fuzzy, no-wrap
504 #| msgid "B<reallocarray>():"
505 msgid "B<malloc>()"
506 msgstr "B<reallocarray>():"
507
508 #. type: TQ
509 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
510 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
511 #, no-wrap
512 msgid "B<free>()"
513 msgstr ""
514
515 #. type: TQ
516 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
517 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
518 #, fuzzy, no-wrap
519 #| msgid "B<syscall>(2)"
520 msgid "B<calloc>()"
521 msgstr "B<syscall>(2)"
522
523 #. type: TQ
524 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
525 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
526 #, fuzzy, no-wrap
527 #| msgid "B<reallocarray>():"
528 msgid "B<realloc>()"
529 msgstr "B<reallocarray>():"
530
531 #. type: Plain text
532 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
533 #: opensuse-tumbleweed
534 msgid "C23, POSIX.1-2024."
535 msgstr "C23, POSIX.1-2024."
536
537 #. type: TP
538 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
539 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
540 #, fuzzy, no-wrap
541 #| msgid "B<reallocarray>():"
542 msgid "B<reallocarray>()"
543 msgstr "B<reallocarray>():"
544
545 #. type: Plain text
546 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
547 #: opensuse-tumbleweed
548 msgid "POSIX.1-2024."
549 msgstr "POSIX.1-2024."
550
551 #. type: SS
552 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
553 #: opensuse-tumbleweed
554 #, fuzzy, no-wrap
555 #| msgid "B<reallocarray>():"
556 msgid "realloc(p, 0)"
557 msgstr "B<reallocarray>():"
558
559 #. type: Plain text
560 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
561 #: opensuse-tumbleweed
562 msgid ""
563 "The behavior of I<realloc(p,\\ 0)> in glibc doesn't conform to any of C99, "
564 "C11, POSIX.1-2001, POSIX.1-2004, POSIX.1-2008, POSIX.1-2013, POSIX.1-2017, "
565 "or POSIX.1-2024. The C17 specification was changed to make it conforming, "
566 "but that specification made it impossible to write code that reliably "
567 "determines if the input pointer is freed after I<realloc(p,\\ 0)>, and C23 "
568 "changed it again to make this undefined behavior, acknowledging that the C17 "
569 "specification was broad enough, so that undefined behavior wasn't worse than "
570 "that."
571 msgstr ""
572
573 #. type: Plain text
574 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
575 #: opensuse-tumbleweed
576 msgid "B<reallocarray>() suffers the same issues in glibc."
577 msgstr ""
578
579 #. type: Plain text
580 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
581 #: opensuse-tumbleweed
582 msgid "musl libc and the BSDs conform to all versions of ISO C and POSIX.1."
583 msgstr ""
584
585 #. type: Plain text
586 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
587 #: opensuse-tumbleweed
588 msgid ""
589 "gnulib provides the I<realloc-posix> module, which provides wrappers "
590 "B<realloc>() and B<reallocarray>() that conform to all versions of ISO C "
591 "and POSIX.1."
592 msgstr ""
593
594 #. type: Plain text
595 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
596 #: opensuse-tumbleweed
597 msgid ""
598 "There's a proposal to standardize the BSD behavior: E<.UR https:\\://"
599 "www.open-std.org/\\:jtc1/\\:sc22/\\:wg14/\\:www/\\:docs/\\:n3621.txt> "
600 "E<.UE .>"
601 msgstr ""
602
603 #. type: SH
604 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
605 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
606 #, no-wrap
607 msgid "HISTORY"
608 msgstr "HISTORIAL"
609
610 #. type: Plain text
611 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
612 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
613 msgid "POSIX.1-2001, C89."
614 msgstr "POSIX.1-2001, C89."
615
616 #. type: Plain text
617 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
618 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
619 msgid "glibc 2.26. OpenBSD 5.6, FreeBSD 11.0."
620 msgstr ""
621
622 #. type: Plain text
623 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
624 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
625 msgid ""
626 "B<malloc>() and related functions rejected sizes greater than "
627 "B<PTRDIFF_MAX> starting in glibc 2.30."
628 msgstr ""
629
630 #. type: Plain text
631 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
632 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
633 msgid "B<free>() preserved I<errno> starting in glibc 2.33."
634 msgstr ""
635
636 #. type: SS
637 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
638 #: opensuse-tumbleweed
639 #, fuzzy, no-wrap
640 #| msgid "B<reallocarray>():"
641 msgid "realloc(p,\\ 0)"
642 msgstr "B<reallocarray>():"
643
644 #. type: Plain text
645 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
646 #: opensuse-tumbleweed
647 msgid ""
648 "C89 was ambiguous in its specification of I<realloc(p,\\ 0)>. C99 partially "
649 "fixed this."
650 msgstr ""
651
652 #. type: Plain text
653 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
654 #: opensuse-tumbleweed
655 msgid ""
656 "The original implementation in glibc would have been conforming to C99. "
657 "However, and ironically, trying to comply with C99 before the standard was "
658 "released, glibc changed its behavior in glibc 2.1.1 into something that "
659 "ended up not conforming to the final C99 specification (but this is debated, "
660 "as the wording of the standard seems self-contradicting)."
661 msgstr ""
662
663 #. type: SH
664 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
665 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
666 #, no-wrap
667 msgid "NOTES"
668 msgstr "NOTAS"
669
670 #. type: Plain text
671 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
672 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
673 #, fuzzy
674 #| msgid ""
675 #| "Linux follows an optimistic memory allocation strategy. This means that "
676 #| "when B<malloc()> returns non-NULL there is no guarantee that the memory "
677 #| "really is available. In case it turns out that the system is out of "
678 #| "memory, one or more processes will be killed by the infamous OOM killer."
679 msgid ""
680 "By default, Linux follows an optimistic memory allocation strategy. This "
681 "means that when B<malloc>() returns non-NULL there is no guarantee that the "
682 "memory really is available. In case it turns out that the system is out of "
683 "memory, one or more processes will be killed by the OOM killer. For more "
684 "information, see the description of I</proc/sys/vm/overcommit_memory> and I</"
685 "proc/sys/vm/oom_adj> in B<proc>(5), and the Linux kernel source file "
686 "I<Documentation/vm/overcommit-accounting.rst>."
687 msgstr ""
688 "Linux sigue una estrategia de asignación de memoria optimista. Ésto "
689 "significa que cuando B<malloc()> devuelve un valor distinto de NULL no hay "
690 "garantía de que la memoria esté realmente disponible. En caso de el sistema "
691 "se haya quedado sin memoria, uno o más procesos serán matados por el infame "
692 "asesino 00M."
693
694 #. type: Plain text
695 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
696 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
697 msgid ""
698 "Normally, B<malloc>() allocates memory from the heap, and adjusts the size "
699 "of the heap as required, using B<sbrk>(2). When allocating blocks of memory "
700 "larger than B<MMAP_THRESHOLD> bytes, the glibc B<malloc>() implementation "
701 "allocates the memory as a private anonymous mapping using B<mmap>(2). "
702 "B<MMAP_THRESHOLD> is 128\\ kB by default, but is adjustable using "
703 "B<mallopt>(3). Prior to Linux 4.7 allocations performed using B<mmap>(2) "
704 "were unaffected by the B<RLIMIT_DATA> resource limit; since Linux 4.7, this "
705 "limit is also enforced for allocations performed using B<mmap>(2)."
706 msgstr ""
707
708 #. type: Plain text
709 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
710 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
711 msgid ""
712 "To avoid corruption in multithreaded applications, mutexes are used "
713 "internally to protect the memory-management data structures employed by "
714 "these functions. In a multithreaded application in which threads "
715 "simultaneously allocate and free memory, there could be contention for these "
716 "mutexes. To scalably handle memory allocation in multithreaded "
717 "applications, glibc creates additional I<memory allocation arenas> if mutex "
718 "contention is detected. Each arena is a large region of memory that is "
719 "internally allocated by the system (using B<brk>(2) or B<mmap>(2)), and "
720 "managed with its own mutexes."
721 msgstr ""
722
723 #. type: Plain text
724 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
725 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
726 msgid ""
727 "If your program uses a private memory allocator, it should do so by "
728 "replacing B<malloc>(), B<free>(), B<calloc>(), and B<realloc>(). The "
729 "replacement functions must implement the documented glibc behaviors, "
730 "including I<errno> handling, size-zero allocations, and overflow checking; "
731 "otherwise, other library routines may crash or operate incorrectly. For "
732 "example, if the replacement I<free>() does not preserve I<errno>, then "
733 "seemingly unrelated library routines may fail without having a valid reason "
734 "in I<errno>. Private memory allocators may also need to replace other glibc "
735 "functions; see \"Replacing malloc\" in the glibc manual for details."
736 msgstr ""
737
738 #. type: Plain text
739 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
740 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
741 #, fuzzy
742 #| msgid ""
743 #| "Crashes in B<malloc>(), B<calloc>(), B<realloc>(), or B<free>() are "
744 #| "almost always related to heap corruption, such as overflowing an "
745 #| "allocated chunk or freeing the same pointer twice."
746 msgid ""
747 "Crashes in memory allocators are almost always related to heap corruption, "
748 "such as overflowing an allocated chunk or freeing the same pointer twice."
749 msgstr ""
750 "Los caídas de B<malloc>(), B<calloc>(), B<realloc>() o B<free>() casi "
751 "siempre están relacionadas con la corrupción de la memoria montón (heap), "
752 "tal como el desbordamiento de una porción de memoria reservada o la "
753 "liberación del mismo puntero dos veces."
754
755 #. type: Plain text
756 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
757 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
758 msgid ""
759 "The B<malloc>() implementation is tunable via environment variables; see "
760 "B<mallopt>(3) for details."
761 msgstr ""
762
763 #. type: SS
764 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
765 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
766 #, no-wrap
767 msgid "Nonportable behavior"
768 msgstr ""
769
770 #. type: Plain text
771 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
772 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
773 msgid ""
774 "The behavior of these functions when the requested size is zero is glibc "
775 "specific; other implementations may return NULL without setting I<errno>, "
776 "and portable POSIX programs should tolerate such behavior. See "
777 "B<realloc>(3p)."
778 msgstr ""
779
780 #. type: Plain text
781 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
782 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
783 msgid ""
784 "POSIX requires memory allocators to set I<errno> upon failure. However, the "
785 "C standard does not require this, and applications portable to non-POSIX "
786 "platforms should not assume this."
787 msgstr ""
788
789 #. type: Plain text
790 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
791 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
792 msgid ""
793 "Portable programs should not use private memory allocators, as POSIX and the "
794 "C standard do not allow replacement of B<malloc>(), B<free>(), B<calloc>(), "
795 "and B<realloc>()."
796 msgstr ""
797
798 #. type: SH
799 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
800 #: opensuse-tumbleweed
801 #, no-wrap
802 msgid "BUGS"
803 msgstr "ERRORES"
804
805 #. type: Plain text
806 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
807 #: opensuse-tumbleweed
808 msgid ""
809 "Programmers would naturally expect by induction that I<\\%realloc(p,\\ "
810 "size)> is consistent with I<free(p)> and I<malloc(size)>, as that is the "
811 "behavior in the general case. This is not explicitly required by "
812 "POSIX.1-2024 or C11, but all conforming implementations are consistent with "
813 "that."
814 msgstr ""
815
816 #. type: Plain text
817 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
818 #: opensuse-tumbleweed
819 msgid ""
820 "The glibc implementation of B<realloc>() is not consistent with that, and "
821 "as a consequence, it is dangerous to call I<\\%realloc(p,\\ 0)> in glibc."
822 msgstr ""
823
824 #. type: Plain text
825 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
826 #: opensuse-tumbleweed
827 msgid ""
828 "A trivial workaround for glibc is calling it as I<\\%realloc(p,\\ size?"
829 "size:1)>."
830 msgstr ""
831
832 #. type: Plain text
833 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
834 #: opensuse-tumbleweed
835 msgid ""
836 "The workaround for B<reallocarray>() in glibc \\[em]which shares the same "
837 "bug\\[em] would be I<\\%reallocarray(p,\\ n?n:1,\\ size?size:1)>."
838 msgstr ""
839
840 #. type: SH
841 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
842 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
843 #, no-wrap
844 msgid "EXAMPLES"
845 msgstr "EJEMPLOS"
846
847 #. type: Plain text
848 #: archlinux debian-unstable fedora-44 fedora-rawhide mageia-cauldron
849 #: opensuse-leap-16-1 opensuse-tumbleweed
850 #, no-wrap
851 msgid ""
852 "#include E<lt>err.hE<gt>\n"
853 "#include E<lt>stddef.hE<gt>\n"
854 "#include E<lt>stdio.hE<gt>\n"
855 "#include E<lt>stdlib.hE<gt>\n"
856 "#include E<lt>string.hE<gt>\n"
857 "\\&\n"
858 "#define MALLOCARRAY(n, type) ((type *) my_mallocarray(n, sizeof(type)))\n"
859 "#define MALLOC(type) MALLOCARRAY(1, type)\n"
860 "\\&\n"
861 "static inline void *my_mallocarray(size_t n, size_t size);\n"
862 "\\&\n"
863 "int\n"
864 "main(void)\n"
865 "{\n"
866 " char *p;\n"
867 "\\&\n"
868 " p = MALLOCARRAY(32, char);\n"
869 " if (p == NULL)\n"
870 " err(EXIT_FAILURE, \"malloc\");\n"
871 "\\&\n"
872 " strlcpy(p, \"foo\", 32);\n"
873 " puts(p);\n"
874 "}\n"
875 "\\&\n"
876 "static inline void *\n"
877 "my_mallocarray(size_t n, size_t size)\n"
878 "{\n"
879 " return reallocarray(NULL, n, size);\n"
880 "}\n"
881 msgstr ""
882
883 #. type: SH
884 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
885 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
886 #, no-wrap
887 msgid "SEE ALSO"
888 msgstr "VÉASE TAMBIÉN"
889
890 #. type: Plain text
891 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
892 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
893 msgid ""
894 "B<valgrind>(1), B<brk>(2), B<mmap>(2), B<alloca>(3), B<malloc_get_state>(3), "
895 "B<malloc_info>(3), B<malloc_trim>(3), B<malloc_usable_size>(3), "
896 "B<mallopt>(3), B<mcheck>(3), B<mtrace>(3), B<posix_memalign>(3)"
897 msgstr ""
898 "B<valgrind>(1), B<brk>(2), B<mmap>(2), B<alloca>(3), B<malloc_get_state>(3), "
899 "B<malloc_info>(3), B<malloc_trim>(3), B<malloc_usable_size>(3), "
900 "B<mallopt>(3), B<mcheck>(3), B<mtrace>(3), B<posix_memalign>(3)"
901
902 #. type: Plain text
903 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
904 #: opensuse-tumbleweed
905 msgid ""
906 "For details of the GNU C library implementation, see E<.UR https:\\://"
907 "sourceware.org/glibc/wiki/MallocInternals> E<.UE .>"
908 msgstr ""
909
910 #. type: TH
911 #: debian-trixie
912 #, no-wrap
913 msgid "2024-05-02"
914 msgstr "2 Mayo 2024"
915
916 #. type: TH
917 #: debian-trixie
918 #, no-wrap
919 msgid "Linux man-pages 6.9.1"
920 msgstr "Páginas de Manual de Linux 6.9.1"
921
922 #. type: Plain text
923 #: debian-trixie
924 msgid "Standard C library (I<libc>, I<-lc>)"
925 msgstr "Biblioteca Estándar C (I<libc>, I<-lc>)"
926
927 #. type: Plain text
928 #: debian-trixie
929 #, fuzzy, no-wrap
930 #| msgid ""
931 #| "B<void *malloc(size_t >I<size>B<);>\n"
932 #| "B<void free(void >I<*ptr>B<);>\n"
933 #| "B<void *calloc(size_t >I<nmemb>B<, size_t >I<size>B<);>\n"
934 #| "B<void *realloc(void >I<*ptr>B<, size_t >I<size>B<);>\n"
935 #| "B<void *reallocarray(void >I<*ptr>B<, size_t >I<nmemb>B<, size_t >I<size>B<);>\n"
936 msgid ""
937 "B<void *malloc(size_t >I<size>B<);>\n"
938 "B<void free(void *_Nullable >I<ptr>B<);>\n"
939 "B<void *calloc(size_t >I<nmemb>B<, size_t >I<size>B<);>\n"
940 "B<void *realloc(void *_Nullable >I<ptr>B<, size_t >I<size>B<);>\n"
941 "B<void *reallocarray(void *_Nullable >I<ptr>B<, size_t >I<nmemb>B<, size_t >I<size>B<);>\n"
942 msgstr ""
943 "B<void *malloc(size_t >I<size>B<);>\n"
944 "B<void free(void >I<*ptr>B<);>\n"
945 "B<void *calloc(size_t >I<nmemb>B<, size_t >I<size>B<);>\n"
946 "B<void *realloc(void >I<*ptr>B<, size_t >I<size>B<);>\n"
947 "B<void *reallocarray(void >I<*ptr>B<, size_t >I<nmemb>B<, size_t >I<size>B<);>\n"
948
949 #. type: Plain text
950 #: debian-trixie fedora-44 fedora-rawhide
951 #, fuzzy
952 #| msgid ""
953 #| "The B<free>() function frees the memory space pointed to by I<ptr>, "
954 #| "which must have been returned by a previous call to B<malloc>(), "
955 #| "B<calloc>(), or B<realloc>(). Otherwise, or if I<free(ptr)> has already "
956 #| "been called before, undefined behavior occurs. If I<ptr> is NULL, no "
957 #| "operation is performed."
958 msgid ""
959 "The B<free>() function frees the memory space pointed to by I<ptr>, which "
960 "must have been returned by a previous call to B<malloc>() or related "
961 "functions. Otherwise, or if I<ptr> has already been freed, undefined "
962 "behavior occurs. If I<ptr> is NULL, no operation is performed."
963 msgstr ""
964 "B<free>() libera el espacio de memoria apuntado por I<ptr>, que debe haber "
965 "sido devuelto por una llamada previa a B<malloc>(), B<calloc>() o "
966 "B<realloc>(). En caso contrario, o si B<free(ptr)> ya se ha llamado antes, "
967 "se produce un comportamiento indefinido. Si I<ptr> es NULL, no se realiza "
968 "ninguna operación."
969
970 #. type: Plain text
971 #: debian-trixie
972 msgid ""
973 "The B<calloc>() function allocates memory for an array of I<nmemb> elements "
974 "of I<size> bytes each and returns a pointer to the allocated memory. The "
975 "memory is set to zero. If I<nmemb> or I<size> is 0, then B<calloc>() "
976 "returns a unique pointer value that can later be successfully passed to "
977 "B<free>()."
978 msgstr ""
979
980 #. type: Plain text
981 #: debian-trixie
982 msgid ""
983 "If the multiplication of I<nmemb> and I<size> would result in integer "
984 "overflow, then B<calloc>() returns an error. By contrast, an integer "
985 "overflow would not be detected in the following call to B<malloc>(), with "
986 "the result that an incorrectly sized block of memory would be allocated:"
987 msgstr ""
988
989 #. type: Plain text
990 #: debian-trixie
991 #, no-wrap
992 msgid "malloc(nmemb * size);\n"
993 msgstr "malloc(nmemb * size);\n"
994
995 #. type: Plain text
996 #: debian-trixie fedora-44 fedora-rawhide
997 #, fuzzy
998 #| msgid ""
999 #| "B<realloc()> changes the size of the memory block pointed to by I<ptr> to "
1000 #| "I<size> bytes. The contents will be unchanged to the minimum of the old "
1001 #| "and new sizes; newly allocated memory will be uninitialized. If I<ptr> "
1002 #| "is B<NULL>, the call is equivalent to B<malloc(size)>; if size is equal "
1003 #| "to zero, the call is equivalent to B<free(>I<ptr>B<)>I<.> Unless I<ptr> "
1004 #| "is B<NULL>, it must have been returned by an earlier call to B<malloc()>, "
1005 #| "B<calloc()> or B<realloc()>."
1006 msgid ""
1007 "The B<realloc>() function changes the size of the memory block pointed to "
1008 "by I<ptr> to I<size> bytes. The contents of the memory will be unchanged in "
1009 "the range from the start of the region up to the minimum of the old and new "
1010 "sizes. If the new size is larger than the old size, the added memory will "
1011 "I<not> be initialized."
1012 msgstr ""
1013 "B<realloc()> cambia el tamaño del bloque de memoria apuntado por I<ptr> a "
1014 "I<size> bytes. El contenido permanecerá inalterado hasta el mínimo entre el "
1015 "tamaño viejo y el nuevo; la memoria recién asignada quedará sin "
1016 "inicializar. Si I<ptr> es B<NULL>, la llamada es equivalente a "
1017 "B<malloc(size)>; si size es igual a cero, la llamada es equivalente a "
1018 "B<free(>I<ptr>B<)>I<.> I<ptr> debe haber sido devuelto por una llamada "
1019 "previa a B<malloc()>, B<calloc()> o B<realloc()>, a menos que I<ptr> sea "
1020 "B<NULL>."
1021
1022 #. type: Plain text
1023 #: debian-trixie fedora-44 fedora-rawhide
1024 msgid ""
1025 "If I<ptr> is NULL, then the call is equivalent to I<malloc(size)>, for all "
1026 "values of I<size>."
1027 msgstr ""
1028
1029 #. type: Plain text
1030 #: debian-trixie fedora-44 fedora-rawhide
1031 msgid ""
1032 "If I<size> is equal to zero, and I<ptr> is not NULL, then the call is "
1033 "equivalent to I<free(ptr)> (but see \"Nonportable behavior\" for portability "
1034 "issues)."
1035 msgstr ""
1036
1037 #. type: Plain text
1038 #: debian-trixie fedora-44 fedora-rawhide
1039 msgid ""
1040 "Unless I<ptr> is NULL, it must have been returned by an earlier call to "
1041 "B<malloc> or related functions. If the area pointed to was moved, a "
1042 "I<free(ptr)> is done."
1043 msgstr ""
1044
1045 #. type: Plain text
1046 #: debian-trixie
1047 msgid ""
1048 "The B<reallocarray>() function changes the size of (and possibly moves) "
1049 "the memory block pointed to by I<ptr> to be large enough for an array of "
1050 "I<nmemb> elements, each of which is I<size> bytes. It is equivalent to the "
1051 "call"
1052 msgstr ""
1053
1054 #. type: Plain text
1055 #: debian-trixie
1056 #, fuzzy, no-wrap
1057 #| msgid " realloc(ptr, nmemb * size);\n"
1058 msgid "realloc(ptr, nmemb * size);\n"
1059 msgstr " realloc(ptr, nmemb * size);\n"
1060
1061 #. type: Plain text
1062 #: debian-trixie fedora-44 fedora-rawhide
1063 #, fuzzy
1064 #| msgid ""
1065 #| "B<realloc()> returns a pointer to the newly allocated memory, which is "
1066 #| "suitably aligned for any kind of variable and may be different from "
1067 #| "I<ptr>, or B<NULL> if the request fails. If I<size> was equal to 0, "
1068 #| "either NULL or a pointer suitable to be passed to I<free>() is "
1069 #| "returned. If B<realloc()> fails the original block is left untouched - "
1070 #| "it is not freed or moved."
1071 msgid ""
1072 "The B<realloc>() and B<reallocarray>() functions return NULL if I<ptr> is "
1073 "not NULL and the requested size is zero; this is not considered an error. "
1074 "(See \"Nonportable behavior\" for portability issues.) Otherwise, the "
1075 "returned pointer may be the same as I<ptr> if the allocation was not moved "
1076 "(e.g., there was room to expand the allocation in-place), or different from "
1077 "I<ptr> if the allocation was moved to a new address. If these functions "
1078 "fail, the original block is left untouched; it is not freed or moved."
1079 msgstr ""
1080 "B<realloc()> devuelve un puntero a la memoria recién asignada, que está "
1081 "convenientemente preparada para cualquier tipo de variable y podría ser "
1082 "diferente de I<ptr>, o B<NULL> si la petición falla. Si I<size> es igual a "
1083 "0, se devuelve o bien NULL o bien un puntero susceptible de ser pasado a "
1084 "I<free>().I<Si> B<realloc()> falla el bloque original se queda como estaba - "
1085 "no es liberado ni movido."
1086
1087 #. type: Plain text
1088 #: debian-trixie fedora-44 fedora-rawhide
1089 msgid "C11, POSIX.1-2008."
1090 msgstr "C11, POSIX.1-2008."
1091
1092 #. type: Plain text
1093 #: debian-trixie fedora-44 fedora-rawhide
1094 msgid "None."
1095 msgstr ""
1096
1097 #. type: Plain text
1098 #: debian-trixie
1099 #, no-wrap
1100 msgid ""
1101 "#include E<lt>err.hE<gt>\n"
1102 "#include E<lt>stddef.hE<gt>\n"
1103 "#include E<lt>stdio.hE<gt>\n"
1104 "#include E<lt>stdlib.hE<gt>\n"
1105 "#include E<lt>string.hE<gt>\n"
1106 "\\&\n"
1107 "#define MALLOCARRAY(n, type) ((type *) my_mallocarray(n, sizeof(type)))\n"
1108 "#define MALLOC(type) MALLOCARRAY(1, type)\n"
1109 "\\&\n"
1110 "static inline void *my_mallocarray(size_t nmemb, size_t size);\n"
1111 "\\&\n"
1112 "int\n"
1113 "main(void)\n"
1114 "{\n"
1115 " char *p;\n"
1116 "\\&\n"
1117 " p = MALLOCARRAY(32, char);\n"
1118 " if (p == NULL)\n"
1119 " err(EXIT_FAILURE, \"malloc\");\n"
1120 "\\&\n"
1121 " strlcpy(p, \"foo\", 32);\n"
1122 " puts(p);\n"
1123 "}\n"
1124 "\\&\n"
1125 "static inline void *\n"
1126 "my_mallocarray(size_t nmemb, size_t size)\n"
1127 "{\n"
1128 " return reallocarray(NULL, nmemb, size);\n"
1129 "}\n"
1130 msgstr ""
1131
1132 #. type: Plain text
1133 #: debian-trixie fedora-44 fedora-rawhide
1134 msgid ""
1135 "For details of the GNU C library implementation, see E<.UR https://"
1136 "sourceware.org/glibc/wiki/MallocInternals> E<.UE .>"
1137 msgstr ""
1138
1139 #. type: TH
1140 #: fedora-44 fedora-rawhide
1141 #, no-wrap
1142 msgid "2024-11-17"
1143 msgstr "17 Noviembre 2024"
1144
1145 #. type: TH
1146 #: fedora-44 fedora-rawhide
1147 #, no-wrap
1148 msgid "Linux man-pages 6.13"
1149 msgstr "Páginas de Manual de Linux 6.13"
1150
1151 #. type: Plain text
1152 #: fedora-44 fedora-rawhide
1153 #, fuzzy, no-wrap
1154 #| msgid ""
1155 #| "B<void *malloc(size_t >I<size>B<);>\n"
1156 #| "B<void free(void >I<*ptr>B<);>\n"
1157 #| "B<void *calloc(size_t >I<nmemb>B<, size_t >I<size>B<);>\n"
1158 #| "B<void *realloc(void >I<*ptr>B<, size_t >I<size>B<);>\n"
1159 #| "B<void *reallocarray(void >I<*ptr>B<, size_t >I<nmemb>B<, size_t >I<size>B<);>\n"
1160 msgid ""
1161 "B<void *malloc(size_t >I<size>B<);>\n"
1162 "B<void free(void *_Nullable >I<ptr>B<);>\n"
1163 "B<void *calloc(size_t >I<n>B<, size_t >I<size>B<);>\n"
1164 "B<void *realloc(void *_Nullable >I<ptr>B<, size_t >I<size>B<);>\n"
1165 "B<void *reallocarray(void *_Nullable >I<ptr>B<, size_t >I<n>B<, size_t >I<size>B<);>\n"
1166 msgstr ""
1167 "B<void *malloc(size_t >I<size>B<);>\n"
1168 "B<void free(void >I<*ptr>B<);>\n"
1169 "B<void *calloc(size_t >I<nmemb>B<, size_t >I<size>B<);>\n"
1170 "B<void *realloc(void >I<*ptr>B<, size_t >I<size>B<);>\n"
1171 "B<void *reallocarray(void >I<*ptr>B<, size_t >I<nmemb>B<, size_t >I<size>B<);>\n"
1172
1173 #. type: Plain text
1174 #: fedora-44 fedora-rawhide
1175 msgid ""
1176 "The B<reallocarray>() function changes the size of (and possibly moves) "
1177 "the memory block pointed to by I<ptr> to be large enough for an array of "
1178 "I<n> elements, each of which is I<size> bytes. It is equivalent to the call"
1179 msgstr ""
1180
1181 #. type: Plain text
1182 #: fedora-44 fedora-rawhide
1183 #, fuzzy, no-wrap
1184 #| msgid " realloc(ptr, nmemb * size);\n"
1185 msgid "realloc(ptr, n * size);\n"
1186 msgstr " realloc(ptr, nmemb * size);\n"
1187
1188 #. type: TH
1189 #: mageia-cauldron
1190 #, no-wrap
1191 msgid "Linux man-pages 6.17"
1192 msgstr "Páginas de Manual de Linux 6.17"
1193
1194 #. type: TH
1195 #: opensuse-leap-16-1 opensuse-tumbleweed
1196 #, no-wrap
1197 msgid "Linux man-pages (unreleased)"
1198 msgstr "Páginas de Manual de Linux (no publicadas)"