Debian Codegraph @

po/ru/man3/malloc.3.po

raw
1 # Russian translation of manpages
2 # This file is distributed under the same license as the manpages-l10n package.
3 # Copyright © of this file:
4 # aereiae <[email protected]>, 2014.
5 # Alexey <[email protected]>, 2015.
6 # Azamat Hackimov <[email protected]>, 2013-2017.
7 # Dmitriy S. Seregin <[email protected]>, 2013.
8 # Dmitry Bolkhovskikh <[email protected]>, 2017.
9 # ITriskTI <[email protected]>, 2013.
10 # Max Is <[email protected]>, 2016.
11 # Yuri Kozlov <[email protected]>, 2011-2019.
12 # Иван Павлов <[email protected]>, 2017.
13 # Малянов Евгений Викторович <[email protected]>, 2014.
14 msgid ""
15 msgstr ""
16 "Project-Id-Version: manpages-l10n\n"
17 "POT-Creation-Date: 2026-06-05 06:30+0200\n"
18 "PO-Revision-Date: 2024-12-21 19:50+0300\n"
19 "Last-Translator: Yuri Kozlov <[email protected]>\n"
20 "Language-Team: Russian <[email protected]>\n"
21 "Language: ru\n"
22 "MIME-Version: 1.0\n"
23 "Content-Type: text/plain; charset=UTF-8\n"
24 "Content-Transfer-Encoding: 8bit\n"
25 "Plural-Forms: nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && "
26 "n%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || "
27 "(n%100>=11 && n%100<=14)? 2 : 3);\n"
28 "X-Generator: Lokalize 2.0\n"
29
30 #. type: TH
31 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
32 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
33 #, fuzzy, no-wrap
34 #| msgid "B<malloc>(3)"
35 msgid "malloc"
36 msgstr "B<malloc>(3)"
37
38 #. type: TH
39 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
40 #: opensuse-tumbleweed
41 #, no-wrap
42 msgid "2026-02-08"
43 msgstr "8 февраля 2026 г."
44
45 #. type: TH
46 #: archlinux debian-unstable
47 #, fuzzy, no-wrap
48 #| msgid "Linux man-pages 6.17"
49 msgid "Linux man-pages 6.18"
50 msgstr "Справочные страницы Linux 6.17"
51
52 #. type: SH
53 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
54 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
55 #, no-wrap
56 msgid "NAME"
57 msgstr "НАИМЕНОВАНИЕ"
58
59 #. type: Plain text
60 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
61 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
62 #, fuzzy
63 #| msgid "malloc, free, calloc, realloc - allocate and free dynamic memory"
64 msgid ""
65 "malloc, free, calloc, realloc, reallocarray - allocate and free dynamic "
66 "memory"
67 msgstr ""
68 "malloc, free, calloc, realloc - распределяет и освобождает динамическую "
69 "память"
70
71 #. type: SH
72 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
73 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
74 #, no-wrap
75 msgid "LIBRARY"
76 msgstr "БИБЛИОТЕКА"
77
78 #. type: Plain text
79 #: archlinux debian-unstable fedora-44 fedora-rawhide mageia-cauldron
80 #: opensuse-leap-16-1 opensuse-tumbleweed
81 msgid "Standard C library (I<libc>,\\ I<-lc>)"
82 msgstr "Стандартная библиотека языка C (I<libc>,\\ I<-lc>)"
83
84 #. type: SH
85 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
86 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
87 #, no-wrap
88 msgid "SYNOPSIS"
89 msgstr "СИНТАКСИС"
90
91 #. type: Plain text
92 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
93 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
94 #, no-wrap
95 msgid "B<#include E<lt>stdlib.hE<gt>>\n"
96 msgstr "B<#include E<lt>stdlib.hE<gt>>\n"
97
98 #. type: Plain text
99 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
100 #: opensuse-tumbleweed
101 #, fuzzy, no-wrap
102 #| msgid ""
103 #| "B<void *malloc(size_t >I<size>B<);>\n"
104 #| "B<void free(void >I<*ptr>B<);>\n"
105 #| "B<void *calloc(size_t >I<nmemb>B<, size_t >I<size>B<);>\n"
106 #| "B<void *realloc(void >I<*ptr>B<, size_t >I<size>B<);>\n"
107 #| "B<void *reallocarray(void >I<*ptr>B<, size_t >I<nmemb>B<, size_t >I<size>B<);>\n"
108 msgid ""
109 "B<void *malloc(size_t >I<size>B<);>\n"
110 "B<void free(void *_Nullable >I<p>B<);>\n"
111 "B<void *calloc(size_t >I<n>B<, size_t >I<size>B<);>\n"
112 "B<void *realloc(void *_Nullable >I<p>B<, size_t >I<size>B<);>\n"
113 "B<void *reallocarray(void *_Nullable >I<p>B<, size_t >I<n>B<, size_t >I<size>B<);>\n"
114 msgstr ""
115 "B<void *malloc(size_t >I<size>B<);>\n"
116 "B<void free(void >I<*ptr>B<);>\n"
117 "B<void *calloc(size_t >I<nmemb>B<, size_t >I<size>B<);>\n"
118 "B<void *realloc(void >I<*ptr>B<, size_t >I<size>B<);>\n"
119 "B<void *reallocarray(void >I<*ptr>B<, size_t >I<nmemb>B<, size_t >I<size>B<);>\n"
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 ""
125 "Feature Test Macro Requirements for glibc (see B<feature_test_macros>(7)):"
126 msgstr ""
127 "Требования макроса тестирования свойств для glibc (см. "
128 "B<feature_test_macros>(7)):"
129
130 #. type: Plain text
131 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
132 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
133 msgid "B<reallocarray>():"
134 msgstr "B<reallocarray>():"
135
136 #. type: Plain text
137 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
138 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
139 #, fuzzy, no-wrap
140 #| msgid ""
141 #| "_GNU_SOURCE\n"
142 #| " Since glibc 2.29:\n"
143 #| " _DEFAULT_SOURCE\n"
144 #| " Glibc 2.28 and earlier:\n"
145 #| " _GNU_SOURCE\n"
146 msgid ""
147 " Since glibc 2.29:\n"
148 " _DEFAULT_SOURCE\n"
149 " glibc 2.28 and earlier:\n"
150 " _GNU_SOURCE\n"
151 msgstr ""
152 "_GNU_SOURCE\n"
153 " Начиная с glibc 2.29:\n"
154 " _DEFAULT_SOURCE\n"
155 " В glibc 2.28 и старее:\n"
156 " _GNU_SOURCE\n"
157
158 #. type: SH
159 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
160 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
161 #, no-wrap
162 msgid "DESCRIPTION"
163 msgstr "ОПИСАНИЕ"
164
165 #. type: SS
166 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
167 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
168 #, fuzzy, no-wrap
169 #| msgid "B<malloc>(3)"
170 msgid "malloc()"
171 msgstr "B<malloc>(3)"
172
173 #. type: Plain text
174 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
175 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
176 #, fuzzy
177 #| msgid ""
178 #| "The B<malloc>() function allocates I<size> bytes and returns a pointer "
179 #| "to the allocated memory. I<The memory is not initialized>. If I<size> "
180 #| "is 0, then B<malloc>() returns either NULL, or a unique pointer value "
181 #| "that can later be successfully passed to B<free>()."
182 msgid ""
183 "The B<malloc>() function allocates I<size> bytes and returns a pointer to "
184 "the allocated memory. I<The memory is not initialized>. If I<size> is 0, "
185 "then B<malloc>() returns a unique pointer value that can later be "
186 "successfully passed to B<free>(). (See \"Nonportable behavior\" for "
187 "portability issues.)"
188 msgstr ""
189 "Функция B<malloc>() распределяет I<size> байтов и возвращает указатель на "
190 "распределённую память. I<Память при этом не инициализируется>. Если значение "
191 "I<size> равно 0, то B<malloc>() возвращает или NULL, или уникальный "
192 "указатель, который можно без опасений передавать B<free>()."
193
194 #. type: SS
195 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
196 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
197 #, no-wrap
198 msgid "free()"
199 msgstr ""
200
201 #. type: Plain text
202 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
203 #: opensuse-tumbleweed
204 #, fuzzy
205 #| msgid ""
206 #| "The B<free>() function frees the memory space pointed to by I<ptr>, "
207 #| "which must have been returned by a previous call to B<malloc>(), "
208 #| "B<calloc>(), or B<realloc>(). Otherwise, or if I<free(ptr)> has already "
209 #| "been called before, undefined behavior occurs. If I<ptr> is NULL, no "
210 #| "operation is performed."
211 msgid ""
212 "The B<free>() function frees the memory space pointed to by I<p>, which "
213 "must have been returned by a previous call to B<malloc>() or related "
214 "functions. Otherwise, or if I<p> has already been freed, undefined behavior "
215 "occurs. If I<p> is NULL, no operation is performed."
216 msgstr ""
217 "Функция B<free>() освобождает место в памяти, указанное в I<ptr>, которое "
218 "должно быть получено ранее вызовом функции B<malloc>(), B<calloc>() или "
219 "B<realloc>(). Иначе (или если вызов I<free(ptr)> уже выполнялся) дальнейшее "
220 "поведение не определено. Если значение I<ptr> равно NULL, то не выполняется "
221 "никаких действий."
222
223 #. type: SS
224 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
225 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
226 #, fuzzy, no-wrap
227 #| msgid "B<malloc>(3)"
228 msgid "calloc()"
229 msgstr "B<malloc>(3)"
230
231 #. type: Plain text
232 #: archlinux debian-unstable fedora-44 fedora-rawhide mageia-cauldron
233 #: opensuse-leap-16-1 opensuse-tumbleweed
234 #, fuzzy
235 #| msgid ""
236 #| "The B<malloc>() function allocates I<size> bytes and returns a pointer "
237 #| "to the allocated memory. I<The memory is not initialized>. If I<size> "
238 #| "is 0, then B<malloc>() returns either NULL, or a unique pointer value "
239 #| "that can later be successfully passed to B<free>()."
240 msgid ""
241 "The B<calloc>() function allocates memory for an array of I<n> elements of "
242 "I<size> bytes each and returns a pointer to the allocated memory. The "
243 "memory is set to zero. If I<n> or I<size> is 0, then B<calloc>() returns a "
244 "unique pointer value that can later be successfully passed to B<free>()."
245 msgstr ""
246 "Функция B<malloc>() распределяет I<size> байтов и возвращает указатель на "
247 "распределённую память. I<Память при этом не инициализируется>. Если значение "
248 "I<size> равно 0, то B<malloc>() возвращает или NULL, или уникальный "
249 "указатель, который можно без опасений передавать B<free>()."
250
251 #. type: Plain text
252 #: archlinux debian-unstable fedora-44 fedora-rawhide mageia-cauldron
253 #: opensuse-leap-16-1 opensuse-tumbleweed
254 #, fuzzy
255 #| msgid ""
256 #| "The B<calloc>() function allocates memory for an array of I<nmemb> "
257 #| "elements of I<size> bytes each and returns a pointer to the allocated "
258 #| "memory. The memory is set to zero. If I<nmemb> or I<size> is 0, then "
259 #| "B<calloc>() returns either NULL, or a unique pointer value that can "
260 #| "later be successfully passed to B<free>(). If the multiplication of "
261 #| "I<nmemb> and I<size> would result in integer overflow, then B<calloc>() "
262 #| "returns an error. By contrast, an integer overflow would not be detected "
263 #| "in the following call to B<malloc>(), with the result that an incorrectly "
264 #| "sized block of memory would be allocated:"
265 msgid ""
266 "If the multiplication of I<n> and I<size> would result in integer overflow, "
267 "then B<calloc>() returns an error. By contrast, an integer overflow would "
268 "not be detected in the following call to B<malloc>(), with the result that "
269 "an incorrectly sized block of memory would be allocated:"
270 msgstr ""
271 "Функция B<сalloc>() распределяет память для массива размером I<nmemb> "
272 "элементов по I<size> байтов каждый и возвращает указатель на распределённую "
273 "память. Данные в выделенной памяти при этом обнуляются. Если значение "
274 "I<nmemb> или I<size> равно 0, то B<calloc>() возвращает NULL или уникальный "
275 "указатель, который можно без опасений передавать B<free>(). Если "
276 "перемножение I<nmemb> и I<size> приводит к целочисленному переполнению, то "
277 "B<calloc>() возвращает ошибку. Это отличает её от B<malloc>(), которая не "
278 "обнаруживает целочисленное переполнение и возвращает блок памяти "
279 "неправильного размера:"
280
281 #. type: Plain text
282 #: archlinux debian-unstable fedora-44 fedora-rawhide mageia-cauldron
283 #: opensuse-leap-16-1 opensuse-tumbleweed
284 #, fuzzy, no-wrap
285 #| msgid "malloc(nmemb * size);\n"
286 msgid "malloc(n * size);\n"
287 msgstr "malloc(nmemb * size);\n"
288
289 #. type: SS
290 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
291 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
292 #, fuzzy, no-wrap
293 #| msgid "B<reallocarray>():"
294 msgid "realloc()"
295 msgstr "B<reallocarray>():"
296
297 #. type: Plain text
298 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
299 #: opensuse-tumbleweed
300 #, fuzzy
301 #| msgid ""
302 #| "The B<realloc>() function changes the size of the memory block pointed "
303 #| "to by I<ptr> to I<size> bytes. The contents will be unchanged in the "
304 #| "range from the start of the region up to the minimum of the old and new "
305 #| "sizes. If the new size is larger than the old size, the added memory "
306 #| "will I<not> be initialized. If I<ptr> is NULL, then the call is "
307 #| "equivalent to I<malloc(size)>, for all values of I<size>; if I<size> is "
308 #| "equal to zero, and I<ptr> is not NULL, then the call is equivalent to "
309 #| "I<free(ptr)>. Unless I<ptr> is NULL, it must have been returned by an "
310 #| "earlier call to B<malloc>(), B<calloc>(), or B<realloc>(). If the area "
311 #| "pointed to was moved, a I<free(ptr)> is done."
312 msgid ""
313 "The B<realloc>() function changes the size of the memory block pointed to "
314 "by I<p> to I<size> bytes. The contents of the memory will be unchanged in "
315 "the range from the start of the region up to the minimum of the old and new "
316 "sizes. If the new size is larger than the old size, the added memory will "
317 "I<not> be initialized."
318 msgstr ""
319 "Функция B<realloc>() меняет размер блока памяти, на который указывает "
320 "I<ptr>, на размер, равный I<size> байт. Содержимое памяти не будет изменено "
321 "от начала области в пределах наименьшего из старого и нового размеров. Если "
322 "новый размер больше старого, то добавленная память I<не> будет "
323 "инициализирована. Если значение I<ptr> равно NULL, то вызов эквивалентен "
324 "I<malloc(size)> для всех значений I<size>; если значение I<size> равно нулю "
325 "и I<ptr> не равно NULL, то вызов эквивалентен I<free(ptr)>. Если только "
326 "значение I<ptr> не равно NULL, то должно быть возвращено ранее полученное "
327 "значение от B<malloc>(), B<calloc>() или B<realloc>(). Если область была "
328 "перемещена, то выполняется I<free(ptr)>."
329
330 #. type: Plain text
331 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
332 #: opensuse-tumbleweed
333 msgid ""
334 "If I<p> is NULL, then the call is equivalent to I<malloc(size)>, for all "
335 "values of I<size>."
336 msgstr ""
337
338 #. type: Plain text
339 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
340 #: opensuse-tumbleweed
341 msgid ""
342 "If I<size> is equal to zero, and I<p> is not NULL, then the call is "
343 "equivalent to I<free(p)> (but see \"Nonportable behavior\" for portability "
344 "issues)."
345 msgstr ""
346
347 #. type: Plain text
348 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
349 #: opensuse-tumbleweed
350 msgid ""
351 "Unless I<p> is NULL, it must have been returned by an earlier call to "
352 "B<malloc> or related functions. If the area pointed to was moved, a "
353 "I<free(p)> is done."
354 msgstr ""
355
356 #. type: SS
357 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
358 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
359 #, fuzzy, no-wrap
360 #| msgid "B<reallocarray>():"
361 msgid "reallocarray()"
362 msgstr "B<reallocarray>():"
363
364 #. type: Plain text
365 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
366 #: opensuse-tumbleweed
367 #, fuzzy
368 #| msgid ""
369 #| "The B<reallocarray>() function changes the size of the memory block "
370 #| "pointed to by I<ptr> to be large enough for an array of I<nmemb> "
371 #| "elements, each of which is I<size> bytes. It is equivalent to the call"
372 msgid ""
373 "The B<reallocarray>() function changes the size of (and possibly moves) "
374 "the memory block pointed to by I<p> to be large enough for an array of I<n> "
375 "elements, each of which is I<size> bytes. It is equivalent to the call"
376 msgstr ""
377 "Функция B<reallocarray>() изменяет размер блока памяти, на который указывает "
378 "I<ptr>, таким образом, чтобы он смог вместить массив из I<nmemb> элементов, "
379 "каждый из которых занимает I<size> байт. Она эквивалентна вызову"
380
381 #. type: Plain text
382 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
383 #: opensuse-tumbleweed
384 #, fuzzy, no-wrap
385 #| msgid " realloc(ptr, nmemb * size);\n"
386 msgid "realloc(p, n * size);\n"
387 msgstr " realloc(ptr, nmemb * size);\n"
388
389 #. type: Plain text
390 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
391 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
392 #, fuzzy
393 #| msgid ""
394 #| "However, unlike that B<realloc>() call, B<reallocarray>() fails safely "
395 #| "in the case where the multiplication would overflow. If such an overflow "
396 #| "occurs, B<reallocarray>() returns NULL, sets I<errno> to B<ENOMEM>, and "
397 #| "leaves the original block of memory unchanged."
398 msgid ""
399 "However, unlike that B<realloc>() call, B<reallocarray>() fails safely in "
400 "the case where the multiplication would overflow. If such an overflow "
401 "occurs, B<reallocarray>() returns an error."
402 msgstr ""
403 "Однако в отличие от вызова B<realloc>(), функция B<reallocarray>() безопасно "
404 "завершается ошибкой в случае возникновения переполнения умножения. Если это "
405 "происходит, то B<reallocarray>() возвращает NULL, присваивает I<errno> "
406 "значение B<ENOMEM> и оставляет первоначальный блок памяти в неизменном виде."
407
408 #. type: SH
409 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
410 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
411 #, no-wrap
412 msgid "RETURN VALUE"
413 msgstr "ВОЗВРАЩАЕМОЕ ЗНАЧЕНИЕ"
414
415 #. type: Plain text
416 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
417 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
418 #, fuzzy
419 #| msgid ""
420 #| "The B<malloc>() and B<calloc>() functions return a pointer to the "
421 #| "allocated memory, which is suitably aligned for any built-in type. On "
422 #| "error, these functions return NULL. NULL may also be returned by a "
423 #| "successful call to B<malloc>() with a I<size> of zero, or by a "
424 #| "successful call to B<calloc>() with I<nmemb> or I<size> equal to zero."
425 msgid ""
426 "The B<malloc>(), B<calloc>(), B<realloc>(), and B<reallocarray>() functions "
427 "return a pointer to the allocated memory, which is suitably aligned for any "
428 "type that fits into the requested size or less. On error, these functions "
429 "return NULL and set I<errno>. Attempting to allocate more than "
430 "B<PTRDIFF_MAX> bytes is considered an error, as an object that large could "
431 "cause later pointer subtraction to overflow."
432 msgstr ""
433 "Функции B<malloc>() и B<calloc>() возвращают указатель на распределённую "
434 "память, выровненную должным образом для любого встроенного типа. При ошибке "
435 "возвращается NULL. Значение NULL также может быть получено при успешной "
436 "работе вызова B<malloc>(), если значение I<size> равно нулю, или B<calloc>() "
437 "— если значение I<nmemb> или I<size> равно нулю."
438
439 #. type: Plain text
440 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
441 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
442 #, fuzzy
443 #| msgid "The B<free>() function returns no value."
444 msgid "The B<free>() function returns no value, and preserves I<errno>."
445 msgstr "Функция B<free>() ничего не возвращает."
446
447 #. type: Plain text
448 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
449 #: opensuse-tumbleweed
450 msgid ""
451 "The B<realloc>() and B<reallocarray>() functions return NULL if I<p> is "
452 "not NULL and the requested size is zero; this is not considered an error. "
453 "(See \"Nonportable behavior\" for portability issues.) Otherwise, the "
454 "returned pointer may be the same as I<p> if the allocation was not moved "
455 "(e.g., there was room to expand the allocation in-place), or different from "
456 "I<p> if the allocation was moved to a new address. If these functions fail, "
457 "the original block is left untouched; it is not freed or moved."
458 msgstr ""
459
460 #. type: SH
461 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
462 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
463 #, no-wrap
464 msgid "ERRORS"
465 msgstr "ОШИБКИ"
466
467 #. type: Plain text
468 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
469 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
470 msgid ""
471 "B<calloc>(), B<malloc>(), B<realloc>(), and B<reallocarray>() can fail with "
472 "the following error:"
473 msgstr ""
474 "Функции B<calloc>(), B<malloc>(), B<realloc>() и B<reallocarray>() могут "
475 "завершаться со следующей ошибкой:"
476
477 #. type: TP
478 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
479 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
480 #, no-wrap
481 msgid "B<ENOMEM>"
482 msgstr "B<ENOMEM>"
483
484 #. type: Plain text
485 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
486 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
487 #, fuzzy
488 #| msgid ""
489 #| "Out of memory. Possibly, the application hit the B<RLIMIT_AS> or "
490 #| "B<RLIMIT_DATA> limit described in B<getrlimit>(2)."
491 msgid ""
492 "Out of memory. Possibly, the application hit the B<RLIMIT_AS> or "
493 "B<RLIMIT_DATA> limit described in B<getrlimit>(2). Another reason could be "
494 "that the number of mappings created by the caller process exceeded the limit "
495 "specified by I</proc/sys/vm/max_map_count>."
496 msgstr ""
497 "Не хватает памяти. Вероятно приложение достигнут лимит B<RLIMIT_AS> или "
498 "B<RLIMIT_DATA>, описанный в B<getrlimit>(2)."
499
500 #. type: SH
501 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
502 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
503 #, no-wrap
504 msgid "ATTRIBUTES"
505 msgstr "АТРИБУТЫ"
506
507 #. type: Plain text
508 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
509 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
510 msgid ""
511 "For an explanation of the terms used in this section, see B<attributes>(7)."
512 msgstr "Описание терминов данного раздела смотрите в B<attributes>(7)."
513
514 #. type: tbl table
515 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
516 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
517 #, no-wrap
518 msgid "Interface"
519 msgstr "Интерфейс"
520
521 #. type: tbl table
522 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
523 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
524 #, no-wrap
525 msgid "Attribute"
526 msgstr "Атрибут"
527
528 #. type: tbl table
529 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
530 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
531 #, no-wrap
532 msgid "Value"
533 msgstr "Значение"
534
535 #. type: tbl table
536 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
537 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
538 #, no-wrap
539 msgid ".na\n"
540 msgstr ".na\n"
541
542 #. type: tbl table
543 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
544 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
545 #, no-wrap
546 msgid ".nh\n"
547 msgstr ".nh\n"
548
549 #. type: tbl table
550 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
551 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
552 #, fuzzy, no-wrap
553 #| msgid ""
554 #| "B<calloc>(),\n"
555 #| "B<realloc>()"
556 msgid ""
557 "B<malloc>(),\n"
558 "B<free>(),\n"
559 "B<calloc>(),\n"
560 "B<realloc>()"
561 msgstr ""
562 "B<calloc>(),\n"
563 "B<realloc>()"
564
565 #. type: tbl table
566 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
567 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
568 #, no-wrap
569 msgid "Thread safety"
570 msgstr "Безвредность в нитях"
571
572 #. type: tbl table
573 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
574 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
575 #, no-wrap
576 msgid "MT-Safe"
577 msgstr "MT-Safe"
578
579 #. type: SH
580 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
581 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
582 #, no-wrap
583 msgid "STANDARDS"
584 msgstr "СТАНДАРТЫ"
585
586 #. type: TP
587 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
588 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
589 #, fuzzy, no-wrap
590 #| msgid "B<malloc>(3)"
591 msgid "B<malloc>()"
592 msgstr "B<malloc>(3)"
593
594 #. type: TQ
595 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
596 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
597 #, fuzzy, no-wrap
598 #| msgid "B<tee>(2)"
599 msgid "B<free>()"
600 msgstr "B<tee>(2)"
601
602 #. type: TQ
603 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
604 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
605 #, fuzzy, no-wrap
606 #| msgid "B<malloc>(3)"
607 msgid "B<calloc>()"
608 msgstr "B<malloc>(3)"
609
610 #. type: TQ
611 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
612 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
613 #, fuzzy, no-wrap
614 #| msgid "B<reallocarray>():"
615 msgid "B<realloc>()"
616 msgstr "B<reallocarray>():"
617
618 #. type: Plain text
619 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
620 #: opensuse-tumbleweed
621 #, fuzzy
622 #| msgid "POSIX.1-2024."
623 msgid "C23, POSIX.1-2024."
624 msgstr "POSIX.1-2024."
625
626 #. type: TP
627 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
628 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
629 #, fuzzy, no-wrap
630 #| msgid "B<reallocarray>():"
631 msgid "B<reallocarray>()"
632 msgstr "B<reallocarray>():"
633
634 #. type: Plain text
635 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
636 #: opensuse-tumbleweed
637 msgid "POSIX.1-2024."
638 msgstr "POSIX.1-2024."
639
640 #. type: SS
641 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
642 #: opensuse-tumbleweed
643 #, fuzzy, no-wrap
644 #| msgid "B<reallocarray>():"
645 msgid "realloc(p, 0)"
646 msgstr "B<reallocarray>():"
647
648 #. type: Plain text
649 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
650 #: opensuse-tumbleweed
651 msgid ""
652 "The behavior of I<realloc(p,\\ 0)> in glibc doesn't conform to any of C99, "
653 "C11, POSIX.1-2001, POSIX.1-2004, POSIX.1-2008, POSIX.1-2013, POSIX.1-2017, "
654 "or POSIX.1-2024. The C17 specification was changed to make it conforming, "
655 "but that specification made it impossible to write code that reliably "
656 "determines if the input pointer is freed after I<realloc(p,\\ 0)>, and C23 "
657 "changed it again to make this undefined behavior, acknowledging that the C17 "
658 "specification was broad enough, so that undefined behavior wasn't worse than "
659 "that."
660 msgstr ""
661
662 #. type: Plain text
663 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
664 #: opensuse-tumbleweed
665 #, fuzzy
666 #| msgid "B<memrchr>() first appeared in glibc in version 2.2."
667 msgid "B<reallocarray>() suffers the same issues in glibc."
668 msgstr "Функция B<memrchr>() впервые появилась в glibc 2.2."
669
670 #. type: Plain text
671 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
672 #: opensuse-tumbleweed
673 msgid "musl libc and the BSDs conform to all versions of ISO C and POSIX.1."
674 msgstr ""
675
676 #. type: Plain text
677 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
678 #: opensuse-tumbleweed
679 msgid ""
680 "gnulib provides the I<realloc-posix> module, which provides wrappers "
681 "B<realloc>() and B<reallocarray>() that conform to all versions of ISO C "
682 "and POSIX.1."
683 msgstr ""
684
685 #. type: Plain text
686 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
687 #: opensuse-tumbleweed
688 msgid ""
689 "There's a proposal to standardize the BSD behavior: E<.UR https:\\://"
690 "www.open-std.org/\\:jtc1/\\:sc22/\\:wg14/\\:www/\\:docs/\\:n3621.txt> "
691 "E<.UE .>"
692 msgstr ""
693
694 #. type: SH
695 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
696 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
697 #, no-wrap
698 msgid "HISTORY"
699 msgstr "ИСТОРИЯ"
700
701 #. type: Plain text
702 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
703 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
704 msgid "POSIX.1-2001, C89."
705 msgstr "POSIX.1-2001, C89."
706
707 #. type: Plain text
708 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
709 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
710 msgid "glibc 2.26. OpenBSD 5.6, FreeBSD 11.0."
711 msgstr ""
712
713 #. type: Plain text
714 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
715 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
716 msgid ""
717 "B<malloc>() and related functions rejected sizes greater than "
718 "B<PTRDIFF_MAX> starting in glibc 2.30."
719 msgstr ""
720
721 #. type: Plain text
722 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
723 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
724 msgid "B<free>() preserved I<errno> starting in glibc 2.33."
725 msgstr ""
726
727 #. type: SS
728 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
729 #: opensuse-tumbleweed
730 #, fuzzy, no-wrap
731 #| msgid "B<reallocarray>():"
732 msgid "realloc(p,\\ 0)"
733 msgstr "B<reallocarray>():"
734
735 #. type: Plain text
736 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
737 #: opensuse-tumbleweed
738 msgid ""
739 "C89 was ambiguous in its specification of I<realloc(p,\\ 0)>. C99 partially "
740 "fixed this."
741 msgstr ""
742
743 #. type: Plain text
744 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
745 #: opensuse-tumbleweed
746 msgid ""
747 "The original implementation in glibc would have been conforming to C99. "
748 "However, and ironically, trying to comply with C99 before the standard was "
749 "released, glibc changed its behavior in glibc 2.1.1 into something that "
750 "ended up not conforming to the final C99 specification (but this is debated, "
751 "as the wording of the standard seems self-contradicting)."
752 msgstr ""
753
754 #. type: SH
755 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
756 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
757 #, no-wrap
758 msgid "NOTES"
759 msgstr "ПРИМЕЧАНИЯ"
760
761 #. type: Plain text
762 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
763 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
764 msgid ""
765 "By default, Linux follows an optimistic memory allocation strategy. This "
766 "means that when B<malloc>() returns non-NULL there is no guarantee that the "
767 "memory really is available. In case it turns out that the system is out of "
768 "memory, one or more processes will be killed by the OOM killer. For more "
769 "information, see the description of I</proc/sys/vm/overcommit_memory> and I</"
770 "proc/sys/vm/oom_adj> in B<proc>(5), and the Linux kernel source file "
771 "I<Documentation/vm/overcommit-accounting.rst>."
772 msgstr ""
773 "По умолчанию, Linux придерживается оптимистичной стратегии распределения "
774 "памяти. Это означает, что когда B<malloc>() возвращает значение не NULL, то "
775 "нет никаких гарантий, что память в действительности доступна. Если "
776 "обнаружится, что системе не хватает памяти, то один или несколько процессов "
777 "будут завершены OOM. Дополнительную информацию можно получить из описания I</"
778 "proc/sys/vm/overcommit_memory> и I</proc/sys/vm/oom_adj> в B<proc>(5) и "
779 "файле из исходного кода ядра Linux I<Documentation/vm/overcommit-"
780 "accounting.rst>."
781
782 #. type: Plain text
783 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
784 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
785 msgid ""
786 "Normally, B<malloc>() allocates memory from the heap, and adjusts the size "
787 "of the heap as required, using B<sbrk>(2). When allocating blocks of memory "
788 "larger than B<MMAP_THRESHOLD> bytes, the glibc B<malloc>() implementation "
789 "allocates the memory as a private anonymous mapping using B<mmap>(2). "
790 "B<MMAP_THRESHOLD> is 128\\ kB by default, but is adjustable using "
791 "B<mallopt>(3). Prior to Linux 4.7 allocations performed using B<mmap>(2) "
792 "were unaffected by the B<RLIMIT_DATA> resource limit; since Linux 4.7, this "
793 "limit is also enforced for allocations performed using B<mmap>(2)."
794 msgstr ""
795 "Обычно, B<malloc>() выделяет память из кучи и подгоняет размер кучи "
796 "соответствующим образом с помощью B<sbrk>(2). Если выделяемый блок памяти "
797 "больше чем B<MMAP_THRESHOLD> байт, то реализация B<malloc>() в glibc "
798 "выделяет память с помощью B<mmap>(2) в виде частного анонимного отображения. "
799 "По умолчанию, значение B<MMAP_THRESHOLD> равно 128\\ КБ, но его можно "
800 "изменить с помощью B<mallopt>(3). До Linux 4.7 на выделения, выполняемые с "
801 "помощью B<mmap>(2), не влияет ограничитель ресурса B<RLIMIT_DATA>; начиная с "
802 "Linux 4.7 это ограничение также применяется к выделениям, созданным с "
803 "помощью B<mmap>(2)."
804
805 #. type: Plain text
806 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
807 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
808 msgid ""
809 "To avoid corruption in multithreaded applications, mutexes are used "
810 "internally to protect the memory-management data structures employed by "
811 "these functions. In a multithreaded application in which threads "
812 "simultaneously allocate and free memory, there could be contention for these "
813 "mutexes. To scalably handle memory allocation in multithreaded "
814 "applications, glibc creates additional I<memory allocation arenas> if mutex "
815 "contention is detected. Each arena is a large region of memory that is "
816 "internally allocated by the system (using B<brk>(2) or B<mmap>(2)), and "
817 "managed with its own mutexes."
818 msgstr ""
819 "Внутри данных функций для защиты от повреждений выделяемых структур данных "
820 "управления памятью, используются мьютексы. В многонитевых приложениях, в "
821 "которых нити одновременно выделяют и освобождают память, может возникнуть "
822 "конфликт за обладание этими мьютексами. Чтобы расширить обработку выделения "
823 "памяти в многонитевых приложениях библиотека glibc создаёт дополнительные "
824 "I<области выделения памяти> (memory allocation arenas), если обнаруживается "
825 "конфликт. Каждая область представляет собой большой кусок памяти, который "
826 "внутренне выделен системой (с помощью B<brk>(2) или B<mmap>(2)) и "
827 "управляется своими собственными мьютексами."
828
829 #. type: Plain text
830 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
831 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
832 msgid ""
833 "If your program uses a private memory allocator, it should do so by "
834 "replacing B<malloc>(), B<free>(), B<calloc>(), and B<realloc>(). The "
835 "replacement functions must implement the documented glibc behaviors, "
836 "including I<errno> handling, size-zero allocations, and overflow checking; "
837 "otherwise, other library routines may crash or operate incorrectly. For "
838 "example, if the replacement I<free>() does not preserve I<errno>, then "
839 "seemingly unrelated library routines may fail without having a valid reason "
840 "in I<errno>. Private memory allocators may also need to replace other glibc "
841 "functions; see \"Replacing malloc\" in the glibc manual for details."
842 msgstr ""
843
844 #. type: Plain text
845 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
846 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
847 #, fuzzy
848 #| msgid ""
849 #| "Crashes in B<malloc>(), B<calloc>(), B<realloc>(), or B<free>() are "
850 #| "almost always related to heap corruption, such as overflowing an "
851 #| "allocated chunk or freeing the same pointer twice."
852 msgid ""
853 "Crashes in memory allocators are almost always related to heap corruption, "
854 "such as overflowing an allocated chunk or freeing the same pointer twice."
855 msgstr ""
856 "Аварийные ситуации в B<malloc>(), B<calloc>(), B<realloc>() или B<free>() "
857 "почти всегда связаны с повреждением кучи, например, с переполнением больших "
858 "распределённых участков памяти или освобождением одного и того же указателя "
859 "дважды."
860
861 #. type: Plain text
862 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
863 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
864 msgid ""
865 "The B<malloc>() implementation is tunable via environment variables; see "
866 "B<mallopt>(3) for details."
867 msgstr ""
868 "Реализация B<malloc>() настраивается с помощью переменных окружения; "
869 "подробности смотрите в B<mallopt>(3)."
870
871 #. type: SS
872 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
873 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
874 #, no-wrap
875 msgid "Nonportable behavior"
876 msgstr ""
877
878 #. type: Plain text
879 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
880 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
881 msgid ""
882 "The behavior of these functions when the requested size is zero is glibc "
883 "specific; other implementations may return NULL without setting I<errno>, "
884 "and portable POSIX programs should tolerate such behavior. See "
885 "B<realloc>(3p)."
886 msgstr ""
887
888 #. type: Plain text
889 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
890 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
891 msgid ""
892 "POSIX requires memory allocators to set I<errno> upon failure. However, the "
893 "C standard does not require this, and applications portable to non-POSIX "
894 "platforms should not assume this."
895 msgstr ""
896
897 #. type: Plain text
898 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
899 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
900 msgid ""
901 "Portable programs should not use private memory allocators, as POSIX and the "
902 "C standard do not allow replacement of B<malloc>(), B<free>(), B<calloc>(), "
903 "and B<realloc>()."
904 msgstr ""
905
906 #. type: SH
907 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
908 #: opensuse-tumbleweed
909 #, no-wrap
910 msgid "BUGS"
911 msgstr "ПРОГРАММНЫЕ ОШИБКИ"
912
913 #. type: Plain text
914 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
915 #: opensuse-tumbleweed
916 msgid ""
917 "Programmers would naturally expect by induction that I<\\%realloc(p,\\ "
918 "size)> is consistent with I<free(p)> and I<malloc(size)>, as that is the "
919 "behavior in the general case. This is not explicitly required by "
920 "POSIX.1-2024 or C11, but all conforming implementations are consistent with "
921 "that."
922 msgstr ""
923
924 #. type: Plain text
925 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
926 #: opensuse-tumbleweed
927 msgid ""
928 "The glibc implementation of B<realloc>() is not consistent with that, and "
929 "as a consequence, it is dangerous to call I<\\%realloc(p,\\ 0)> in glibc."
930 msgstr ""
931
932 #. type: Plain text
933 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
934 #: opensuse-tumbleweed
935 msgid ""
936 "A trivial workaround for glibc is calling it as I<\\%realloc(p,\\ size?"
937 "size:1)>."
938 msgstr ""
939
940 #. type: Plain text
941 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
942 #: opensuse-tumbleweed
943 msgid ""
944 "The workaround for B<reallocarray>() in glibc \\[em]which shares the same "
945 "bug\\[em] would be I<\\%reallocarray(p,\\ n?n:1,\\ size?size:1)>."
946 msgstr ""
947
948 #. type: SH
949 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
950 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
951 #, no-wrap
952 msgid "EXAMPLES"
953 msgstr "ПРИМЕРЫ"
954
955 #. type: Plain text
956 #: archlinux debian-unstable fedora-44 fedora-rawhide mageia-cauldron
957 #: opensuse-leap-16-1 opensuse-tumbleweed
958 #, no-wrap
959 msgid ""
960 "#include E<lt>err.hE<gt>\n"
961 "#include E<lt>stddef.hE<gt>\n"
962 "#include E<lt>stdio.hE<gt>\n"
963 "#include E<lt>stdlib.hE<gt>\n"
964 "#include E<lt>string.hE<gt>\n"
965 "\\&\n"
966 "#define MALLOCARRAY(n, type) ((type *) my_mallocarray(n, sizeof(type)))\n"
967 "#define MALLOC(type) MALLOCARRAY(1, type)\n"
968 "\\&\n"
969 "static inline void *my_mallocarray(size_t n, size_t size);\n"
970 "\\&\n"
971 "int\n"
972 "main(void)\n"
973 "{\n"
974 " char *p;\n"
975 "\\&\n"
976 " p = MALLOCARRAY(32, char);\n"
977 " if (p == NULL)\n"
978 " err(EXIT_FAILURE, \"malloc\");\n"
979 "\\&\n"
980 " strlcpy(p, \"foo\", 32);\n"
981 " puts(p);\n"
982 "}\n"
983 "\\&\n"
984 "static inline void *\n"
985 "my_mallocarray(size_t n, size_t size)\n"
986 "{\n"
987 " return reallocarray(NULL, n, size);\n"
988 "}\n"
989 msgstr ""
990
991 #. type: SH
992 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
993 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
994 #, no-wrap
995 msgid "SEE ALSO"
996 msgstr "СМОТРИТЕ ТАКЖЕ"
997
998 #. type: Plain text
999 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
1000 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
1001 msgid ""
1002 "B<valgrind>(1), B<brk>(2), B<mmap>(2), B<alloca>(3), B<malloc_get_state>(3), "
1003 "B<malloc_info>(3), B<malloc_trim>(3), B<malloc_usable_size>(3), "
1004 "B<mallopt>(3), B<mcheck>(3), B<mtrace>(3), B<posix_memalign>(3)"
1005 msgstr ""
1006 "B<valgrind>(1), B<brk>(2), B<mmap>(2), B<alloca>(3), B<malloc_get_state>(3), "
1007 "B<malloc_info>(3), B<malloc_trim>(3), B<malloc_usable_size>(3), "
1008 "B<mallopt>(3), B<mcheck>(3), B<mtrace>(3), B<posix_memalign>(3)"
1009
1010 #. type: Plain text
1011 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
1012 #: opensuse-tumbleweed
1013 #, fuzzy
1014 #| msgid ""
1015 #| "For details of the GNU C library implementation, see E<.UR https://"
1016 #| "sourceware.org/glibc/wiki/MallocInternals> E<.UE .>"
1017 msgid ""
1018 "For details of the GNU C library implementation, see E<.UR https:\\://"
1019 "sourceware.org/glibc/wiki/MallocInternals> E<.UE .>"
1020 msgstr ""
1021 "Информацию о реализации в библиотеке GNU C смотрите в E<.UR https://"
1022 "sourceware.org/glibc/wiki/MallocInternals> E<.UE .>"
1023
1024 #. type: TH
1025 #: debian-trixie
1026 #, no-wrap
1027 msgid "2024-05-02"
1028 msgstr "2 мая 2024 г."
1029
1030 #. type: TH
1031 #: debian-trixie
1032 #, no-wrap
1033 msgid "Linux man-pages 6.9.1"
1034 msgstr "Страницы руководства Linux 6.9.1"
1035
1036 #. type: Plain text
1037 #: debian-trixie
1038 msgid "Standard C library (I<libc>, I<-lc>)"
1039 msgstr "Стандартная библиотека языка C (I<libc>, I<-lc>)"
1040
1041 #. type: Plain text
1042 #: debian-trixie
1043 #, fuzzy, no-wrap
1044 #| msgid ""
1045 #| "B<void *malloc(size_t >I<size>B<);>\n"
1046 #| "B<void free(void >I<*ptr>B<);>\n"
1047 #| "B<void *calloc(size_t >I<nmemb>B<, size_t >I<size>B<);>\n"
1048 #| "B<void *realloc(void >I<*ptr>B<, size_t >I<size>B<);>\n"
1049 #| "B<void *reallocarray(void >I<*ptr>B<, size_t >I<nmemb>B<, size_t >I<size>B<);>\n"
1050 msgid ""
1051 "B<void *malloc(size_t >I<size>B<);>\n"
1052 "B<void free(void *_Nullable >I<ptr>B<);>\n"
1053 "B<void *calloc(size_t >I<nmemb>B<, size_t >I<size>B<);>\n"
1054 "B<void *realloc(void *_Nullable >I<ptr>B<, size_t >I<size>B<);>\n"
1055 "B<void *reallocarray(void *_Nullable >I<ptr>B<, size_t >I<nmemb>B<, size_t >I<size>B<);>\n"
1056 msgstr ""
1057 "B<void *malloc(size_t >I<size>B<);>\n"
1058 "B<void free(void >I<*ptr>B<);>\n"
1059 "B<void *calloc(size_t >I<nmemb>B<, size_t >I<size>B<);>\n"
1060 "B<void *realloc(void >I<*ptr>B<, size_t >I<size>B<);>\n"
1061 "B<void *reallocarray(void >I<*ptr>B<, size_t >I<nmemb>B<, size_t >I<size>B<);>\n"
1062
1063 #. type: Plain text
1064 #: debian-trixie fedora-44 fedora-rawhide
1065 #, fuzzy
1066 #| msgid ""
1067 #| "The B<free>() function frees the memory space pointed to by I<ptr>, "
1068 #| "which must have been returned by a previous call to B<malloc>(), "
1069 #| "B<calloc>(), or B<realloc>(). Otherwise, or if I<free(ptr)> has already "
1070 #| "been called before, undefined behavior occurs. If I<ptr> is NULL, no "
1071 #| "operation is performed."
1072 msgid ""
1073 "The B<free>() function frees the memory space pointed to by I<ptr>, which "
1074 "must have been returned by a previous call to B<malloc>() or related "
1075 "functions. Otherwise, or if I<ptr> has already been freed, undefined "
1076 "behavior occurs. If I<ptr> is NULL, no operation is performed."
1077 msgstr ""
1078 "Функция B<free>() освобождает место в памяти, указанное в I<ptr>, которое "
1079 "должно быть получено ранее вызовом функции B<malloc>(), B<calloc>() или "
1080 "B<realloc>(). Иначе (или если вызов I<free(ptr)> уже выполнялся) дальнейшее "
1081 "поведение не определено. Если значение I<ptr> равно NULL, то не выполняется "
1082 "никаких действий."
1083
1084 #. type: Plain text
1085 #: debian-trixie
1086 #, fuzzy
1087 #| msgid ""
1088 #| "The B<malloc>() function allocates I<size> bytes and returns a pointer "
1089 #| "to the allocated memory. I<The memory is not initialized>. If I<size> "
1090 #| "is 0, then B<malloc>() returns either NULL, or a unique pointer value "
1091 #| "that can later be successfully passed to B<free>()."
1092 msgid ""
1093 "The B<calloc>() function allocates memory for an array of I<nmemb> elements "
1094 "of I<size> bytes each and returns a pointer to the allocated memory. The "
1095 "memory is set to zero. If I<nmemb> or I<size> is 0, then B<calloc>() "
1096 "returns a unique pointer value that can later be successfully passed to "
1097 "B<free>()."
1098 msgstr ""
1099 "Функция B<malloc>() распределяет I<size> байтов и возвращает указатель на "
1100 "распределённую память. I<Память при этом не инициализируется>. Если значение "
1101 "I<size> равно 0, то B<malloc>() возвращает или NULL, или уникальный "
1102 "указатель, который можно без опасений передавать B<free>()."
1103
1104 #. type: Plain text
1105 #: debian-trixie
1106 #, fuzzy
1107 #| msgid ""
1108 #| "The B<calloc>() function allocates memory for an array of I<nmemb> "
1109 #| "elements of I<size> bytes each and returns a pointer to the allocated "
1110 #| "memory. The memory is set to zero. If I<nmemb> or I<size> is 0, then "
1111 #| "B<calloc>() returns either NULL, or a unique pointer value that can "
1112 #| "later be successfully passed to B<free>(). If the multiplication of "
1113 #| "I<nmemb> and I<size> would result in integer overflow, then B<calloc>() "
1114 #| "returns an error. By contrast, an integer overflow would not be detected "
1115 #| "in the following call to B<malloc>(), with the result that an incorrectly "
1116 #| "sized block of memory would be allocated:"
1117 msgid ""
1118 "If the multiplication of I<nmemb> and I<size> would result in integer "
1119 "overflow, then B<calloc>() returns an error. By contrast, an integer "
1120 "overflow would not be detected in the following call to B<malloc>(), with "
1121 "the result that an incorrectly sized block of memory would be allocated:"
1122 msgstr ""
1123 "Функция B<сalloc>() распределяет память для массива размером I<nmemb> "
1124 "элементов по I<size> байтов каждый и возвращает указатель на распределённую "
1125 "память. Данные в выделенной памяти при этом обнуляются. Если значение "
1126 "I<nmemb> или I<size> равно 0, то B<calloc>() возвращает NULL или уникальный "
1127 "указатель, который можно без опасений передавать B<free>(). Если "
1128 "перемножение I<nmemb> и I<size> приводит к целочисленному переполнению, то "
1129 "B<calloc>() возвращает ошибку. Это отличает её от B<malloc>(), которая не "
1130 "обнаруживает целочисленное переполнение и возвращает блок памяти "
1131 "неправильного размера:"
1132
1133 #. type: Plain text
1134 #: debian-trixie
1135 #, no-wrap
1136 msgid "malloc(nmemb * size);\n"
1137 msgstr "malloc(nmemb * size);\n"
1138
1139 #. type: Plain text
1140 #: debian-trixie fedora-44 fedora-rawhide
1141 #, fuzzy
1142 #| msgid ""
1143 #| "The B<realloc>() function changes the size of the memory block pointed "
1144 #| "to by I<ptr> to I<size> bytes. The contents will be unchanged in the "
1145 #| "range from the start of the region up to the minimum of the old and new "
1146 #| "sizes. If the new size is larger than the old size, the added memory "
1147 #| "will I<not> be initialized. If I<ptr> is NULL, then the call is "
1148 #| "equivalent to I<malloc(size)>, for all values of I<size>; if I<size> is "
1149 #| "equal to zero, and I<ptr> is not NULL, then the call is equivalent to "
1150 #| "I<free(ptr)>. Unless I<ptr> is NULL, it must have been returned by an "
1151 #| "earlier call to B<malloc>(), B<calloc>(), or B<realloc>(). If the area "
1152 #| "pointed to was moved, a I<free(ptr)> is done."
1153 msgid ""
1154 "The B<realloc>() function changes the size of the memory block pointed to "
1155 "by I<ptr> to I<size> bytes. The contents of the memory will be unchanged in "
1156 "the range from the start of the region up to the minimum of the old and new "
1157 "sizes. If the new size is larger than the old size, the added memory will "
1158 "I<not> be initialized."
1159 msgstr ""
1160 "Функция B<realloc>() меняет размер блока памяти, на который указывает "
1161 "I<ptr>, на размер, равный I<size> байт. Содержимое памяти не будет изменено "
1162 "от начала области в пределах наименьшего из старого и нового размеров. Если "
1163 "новый размер больше старого, то добавленная память I<не> будет "
1164 "инициализирована. Если значение I<ptr> равно NULL, то вызов эквивалентен "
1165 "I<malloc(size)> для всех значений I<size>; если значение I<size> равно нулю "
1166 "и I<ptr> не равно NULL, то вызов эквивалентен I<free(ptr)>. Если только "
1167 "значение I<ptr> не равно NULL, то должно быть возвращено ранее полученное "
1168 "значение от B<malloc>(), B<calloc>() или B<realloc>(). Если область была "
1169 "перемещена, то выполняется I<free(ptr)>."
1170
1171 #. type: Plain text
1172 #: debian-trixie fedora-44 fedora-rawhide
1173 msgid ""
1174 "If I<ptr> is NULL, then the call is equivalent to I<malloc(size)>, for all "
1175 "values of I<size>."
1176 msgstr ""
1177
1178 #. type: Plain text
1179 #: debian-trixie fedora-44 fedora-rawhide
1180 msgid ""
1181 "If I<size> is equal to zero, and I<ptr> is not NULL, then the call is "
1182 "equivalent to I<free(ptr)> (but see \"Nonportable behavior\" for portability "
1183 "issues)."
1184 msgstr ""
1185
1186 #. type: Plain text
1187 #: debian-trixie fedora-44 fedora-rawhide
1188 msgid ""
1189 "Unless I<ptr> is NULL, it must have been returned by an earlier call to "
1190 "B<malloc> or related functions. If the area pointed to was moved, a "
1191 "I<free(ptr)> is done."
1192 msgstr ""
1193
1194 #. type: Plain text
1195 #: debian-trixie
1196 #, fuzzy
1197 #| msgid ""
1198 #| "The B<reallocarray>() function changes the size of the memory block "
1199 #| "pointed to by I<ptr> to be large enough for an array of I<nmemb> "
1200 #| "elements, each of which is I<size> bytes. It is equivalent to the call"
1201 msgid ""
1202 "The B<reallocarray>() function changes the size of (and possibly moves) "
1203 "the memory block pointed to by I<ptr> to be large enough for an array of "
1204 "I<nmemb> elements, each of which is I<size> bytes. It is equivalent to the "
1205 "call"
1206 msgstr ""
1207 "Функция B<reallocarray>() изменяет размер блока памяти, на который указывает "
1208 "I<ptr>, таким образом, чтобы он смог вместить массив из I<nmemb> элементов, "
1209 "каждый из которых занимает I<size> байт. Она эквивалентна вызову"
1210
1211 #. type: Plain text
1212 #: debian-trixie
1213 #, fuzzy, no-wrap
1214 #| msgid " realloc(ptr, nmemb * size);\n"
1215 msgid "realloc(ptr, nmemb * size);\n"
1216 msgstr " realloc(ptr, nmemb * size);\n"
1217
1218 #. type: Plain text
1219 #: debian-trixie fedora-44 fedora-rawhide
1220 msgid ""
1221 "The B<realloc>() and B<reallocarray>() functions return NULL if I<ptr> is "
1222 "not NULL and the requested size is zero; this is not considered an error. "
1223 "(See \"Nonportable behavior\" for portability issues.) Otherwise, the "
1224 "returned pointer may be the same as I<ptr> if the allocation was not moved "
1225 "(e.g., there was room to expand the allocation in-place), or different from "
1226 "I<ptr> if the allocation was moved to a new address. If these functions "
1227 "fail, the original block is left untouched; it is not freed or moved."
1228 msgstr ""
1229
1230 #. type: Plain text
1231 #: debian-trixie fedora-44 fedora-rawhide
1232 msgid "C11, POSIX.1-2008."
1233 msgstr "C11, POSIX.1-2008."
1234
1235 #. type: Plain text
1236 #: debian-trixie fedora-44 fedora-rawhide
1237 msgid "None."
1238 msgstr "Отсутствуют."
1239
1240 #. type: Plain text
1241 #: debian-trixie
1242 #, no-wrap
1243 msgid ""
1244 "#include E<lt>err.hE<gt>\n"
1245 "#include E<lt>stddef.hE<gt>\n"
1246 "#include E<lt>stdio.hE<gt>\n"
1247 "#include E<lt>stdlib.hE<gt>\n"
1248 "#include E<lt>string.hE<gt>\n"
1249 "\\&\n"
1250 "#define MALLOCARRAY(n, type) ((type *) my_mallocarray(n, sizeof(type)))\n"
1251 "#define MALLOC(type) MALLOCARRAY(1, type)\n"
1252 "\\&\n"
1253 "static inline void *my_mallocarray(size_t nmemb, size_t size);\n"
1254 "\\&\n"
1255 "int\n"
1256 "main(void)\n"
1257 "{\n"
1258 " char *p;\n"
1259 "\\&\n"
1260 " p = MALLOCARRAY(32, char);\n"
1261 " if (p == NULL)\n"
1262 " err(EXIT_FAILURE, \"malloc\");\n"
1263 "\\&\n"
1264 " strlcpy(p, \"foo\", 32);\n"
1265 " puts(p);\n"
1266 "}\n"
1267 "\\&\n"
1268 "static inline void *\n"
1269 "my_mallocarray(size_t nmemb, size_t size)\n"
1270 "{\n"
1271 " return reallocarray(NULL, nmemb, size);\n"
1272 "}\n"
1273 msgstr ""
1274
1275 #. type: Plain text
1276 #: debian-trixie fedora-44 fedora-rawhide
1277 msgid ""
1278 "For details of the GNU C library implementation, see E<.UR https://"
1279 "sourceware.org/glibc/wiki/MallocInternals> E<.UE .>"
1280 msgstr ""
1281 "Информацию о реализации в библиотеке GNU C смотрите в E<.UR https://"
1282 "sourceware.org/glibc/wiki/MallocInternals> E<.UE .>"
1283
1284 #. type: TH
1285 #: fedora-44 fedora-rawhide
1286 #, no-wrap
1287 msgid "2024-11-17"
1288 msgstr "17 ноября 2024 г."
1289
1290 #. type: TH
1291 #: fedora-44 fedora-rawhide
1292 #, no-wrap
1293 msgid "Linux man-pages 6.13"
1294 msgstr "Страницы руководства Linux 6.13"
1295
1296 #. type: Plain text
1297 #: fedora-44 fedora-rawhide
1298 #, fuzzy, no-wrap
1299 #| msgid ""
1300 #| "B<void *malloc(size_t >I<size>B<);>\n"
1301 #| "B<void free(void >I<*ptr>B<);>\n"
1302 #| "B<void *calloc(size_t >I<nmemb>B<, size_t >I<size>B<);>\n"
1303 #| "B<void *realloc(void >I<*ptr>B<, size_t >I<size>B<);>\n"
1304 #| "B<void *reallocarray(void >I<*ptr>B<, size_t >I<nmemb>B<, size_t >I<size>B<);>\n"
1305 msgid ""
1306 "B<void *malloc(size_t >I<size>B<);>\n"
1307 "B<void free(void *_Nullable >I<ptr>B<);>\n"
1308 "B<void *calloc(size_t >I<n>B<, size_t >I<size>B<);>\n"
1309 "B<void *realloc(void *_Nullable >I<ptr>B<, size_t >I<size>B<);>\n"
1310 "B<void *reallocarray(void *_Nullable >I<ptr>B<, size_t >I<n>B<, size_t >I<size>B<);>\n"
1311 msgstr ""
1312 "B<void *malloc(size_t >I<size>B<);>\n"
1313 "B<void free(void >I<*ptr>B<);>\n"
1314 "B<void *calloc(size_t >I<nmemb>B<, size_t >I<size>B<);>\n"
1315 "B<void *realloc(void >I<*ptr>B<, size_t >I<size>B<);>\n"
1316 "B<void *reallocarray(void >I<*ptr>B<, size_t >I<nmemb>B<, size_t >I<size>B<);>\n"
1317
1318 #. type: Plain text
1319 #: fedora-44 fedora-rawhide
1320 #, fuzzy
1321 #| msgid ""
1322 #| "The B<reallocarray>() function changes the size of the memory block "
1323 #| "pointed to by I<ptr> to be large enough for an array of I<nmemb> "
1324 #| "elements, each of which is I<size> bytes. It is equivalent to the call"
1325 msgid ""
1326 "The B<reallocarray>() function changes the size of (and possibly moves) "
1327 "the memory block pointed to by I<ptr> to be large enough for an array of "
1328 "I<n> elements, each of which is I<size> bytes. It is equivalent to the call"
1329 msgstr ""
1330 "Функция B<reallocarray>() изменяет размер блока памяти, на который указывает "
1331 "I<ptr>, таким образом, чтобы он смог вместить массив из I<nmemb> элементов, "
1332 "каждый из которых занимает I<size> байт. Она эквивалентна вызову"
1333
1334 #. type: Plain text
1335 #: fedora-44 fedora-rawhide
1336 #, fuzzy, no-wrap
1337 #| msgid " realloc(ptr, nmemb * size);\n"
1338 msgid "realloc(ptr, n * size);\n"
1339 msgstr " realloc(ptr, nmemb * size);\n"
1340
1341 #. type: TH
1342 #: mageia-cauldron
1343 #, no-wrap
1344 msgid "Linux man-pages 6.17"
1345 msgstr "Страницы руководства Linux 6.17"
1346
1347 #. type: TH
1348 #: opensuse-leap-16-1 opensuse-tumbleweed
1349 #, no-wrap
1350 msgid "Linux man-pages (unreleased)"
1351 msgstr "Страницы руководства Linux (не выпущены)"