@@ -11,7 +11,7 @@ msgid ""
1111msgstr ""
1212"Project-Id-Version : Python 3.11\n "
1313"Report-Msgid-Bugs-To : \n "
14- "POT-Creation-Date : 2023-08-04 14:46 +0000\n "
14+ "POT-Creation-Date : 2023-10-27 15:22 +0000\n "
1515"PO-Revision-Date : 2023-05-24 02:09+0000\n "
1616"
Last-Translator :
Rafael Fontenelle <[email protected] >, 2023\n "
1717"Language-Team : Chinese (China) (https://app.transifex.com/python-doc/teams/5390/zh_CN/)\n "
@@ -634,19 +634,19 @@ msgid ""
634634"following fields:"
635635msgstr "用于描述内存块分配器的结构体。 该结构体下列字段:"
636636
637- #: ../../c-api/memory.rst:411 ../../c-api/memory.rst:651
637+ #: ../../c-api/memory.rst:411 ../../c-api/memory.rst:652
638638msgid "Field"
639639msgstr "域"
640640
641- #: ../../c-api/memory.rst:411 ../../c-api/memory.rst:651
641+ #: ../../c-api/memory.rst:411 ../../c-api/memory.rst:652
642642msgid "Meaning"
643643msgstr "含意"
644644
645- #: ../../c-api/memory.rst:413 ../../c-api/memory.rst:653
645+ #: ../../c-api/memory.rst:413 ../../c-api/memory.rst:654
646646msgid "``void *ctx``"
647647msgstr "``void *ctx``"
648648
649- #: ../../c-api/memory.rst:413 ../../c-api/memory.rst:653
649+ #: ../../c-api/memory.rst:413 ../../c-api/memory.rst:654
650650msgid "user context passed as first argument"
651651msgstr "作为第一个参数传入的用户上下文"
652652
@@ -1054,15 +1054,15 @@ msgstr "pymalloc 分配器"
10541054msgid ""
10551055"Python has a *pymalloc* allocator optimized for small objects (smaller or "
10561056"equal to 512 bytes) with a short lifetime. It uses memory mappings called "
1057- "\" arenas\" with a fixed size of 256 KiB. It falls back to "
1058- ":c:func:`PyMem_RawMalloc` and :c:func:`PyMem_RawRealloc` for allocations "
1059- "larger than 512 bytes."
1057+ "\" arenas\" with a fixed size of either 256 KiB on 32-bit platforms or 1 MiB "
1058+ "on 64-bit platforms. It falls back to :c:func:`PyMem_RawMalloc` and "
1059+ ":c:func:`PyMem_RawRealloc` for allocations larger than 512 bytes."
10601060msgstr ""
1061- "Python 有为具有短生命周期的小对象 (小于或等于 512 字节)优化的 *pymalloc* 分配器。它使用固定大小为 256 KiB 的称为 "
1062- "\" arenas \" 的内存映射。对于大于512字节的分配,它回到使用 :c:func:`PyMem_RawMalloc` 和 "
1063- ":c:func:`PyMem_RawRealloc` 。"
1061+ "Python 有一个针对短生命周期的小对象 (小于或等于 512 字节)进行了优化的 *pymalloc* 分配器。 "
1062+ "它使用名为“arena” 的内存映射,在 32 位平台上的固定大小为 256 KiB,在 64 位平台上的固定大小为 1 MiB。 对于大于 512 "
1063+ "字节的分配,它会回退为 :c:func:`PyMem_RawMalloc` 和 :c:func:`PyMem_RawRealloc` 。"
10641064
1065- #: ../../c-api/memory.rst:626
1065+ #: ../../c-api/memory.rst:627
10661066msgid ""
10671067"*pymalloc* is the :ref:`default allocator <default-memory-allocators>` of "
10681068"the :c:macro:`PYMEM_DOMAIN_MEM` (ex: :c:func:`PyMem_Malloc`) and "
@@ -1072,23 +1072,23 @@ msgstr ""
10721072":c:macro:`PYMEM_DOMAIN_OBJ` (例如: :c:func:`PyObject_Malloc`) 域的 :ref:`默认分配器 "
10731073"<default-memory-allocators>`。"
10741074
1075- #: ../../c-api/memory.rst:630
1075+ #: ../../c-api/memory.rst:631
10761076msgid "The arena allocator uses the following functions:"
10771077msgstr "arena 分配器使用以下函数:"
10781078
1079- #: ../../c-api/memory.rst:632
1079+ #: ../../c-api/memory.rst:633
10801080msgid ":c:func:`!VirtualAlloc` and :c:func:`!VirtualFree` on Windows,"
10811081msgstr "Windows 上的 :c:func:`!VirtualAlloc` 和 :c:func:`!VirtualFree`,"
10821082
1083- #: ../../c-api/memory.rst:633
1083+ #: ../../c-api/memory.rst:634
10841084msgid ":c:func:`!mmap` and :c:func:`!munmap` if available,"
10851085msgstr ":c:func:`!mmap` 和 :c:func:`!munmap`,如果可用的话,"
10861086
1087- #: ../../c-api/memory.rst:634
1087+ #: ../../c-api/memory.rst:635
10881088msgid ":c:func:`malloc` and :c:func:`free` otherwise."
10891089msgstr "否则, :c:func:`malloc` 和 :c:func:`free` 。"
10901090
1091- #: ../../c-api/memory.rst:636
1091+ #: ../../c-api/memory.rst:637
10921092msgid ""
10931093"This allocator is disabled if Python is configured with the "
10941094":option:`--without-pymalloc` option. It can also be disabled at runtime "
@@ -1098,86 +1098,86 @@ msgstr ""
10981098"如果 Python 配置了 :option:`--without-pymalloc` 选项,那么此分配器将被禁用。也可以在运行时使用 "
10991099":envvar:`PYTHONMALLOC`(例如:``PYTHONMALLOC=malloc``)环境变量来禁用它。"
11001100
1101- #: ../../c-api/memory.rst:641
1101+ #: ../../c-api/memory.rst:642
11021102msgid "Customize pymalloc Arena Allocator"
11031103msgstr "自定义 pymalloc Arena 分配器"
11041104
1105- #: ../../c-api/memory.rst:647
1105+ #: ../../c-api/memory.rst:648
11061106msgid ""
11071107"Structure used to describe an arena allocator. The structure has three "
11081108"fields:"
11091109msgstr "用来描述一个 arena 分配器的结构体。这个结构体有三个字段:"
11101110
1111- #: ../../c-api/memory.rst:655
1111+ #: ../../c-api/memory.rst:656
11121112msgid "``void* alloc(void *ctx, size_t size)``"
11131113msgstr "``void* alloc(void *ctx, size_t size)``"
11141114
1115- #: ../../c-api/memory.rst:655
1115+ #: ../../c-api/memory.rst:656
11161116msgid "allocate an arena of size bytes"
11171117msgstr "分配一块 size 字节的区域"
11181118
1119- #: ../../c-api/memory.rst:657
1119+ #: ../../c-api/memory.rst:658
11201120msgid "``void free(void *ctx, void *ptr, size_t size)``"
11211121msgstr "``void free(void *ctx, void *ptr, size_t size)``"
11221122
1123- #: ../../c-api/memory.rst:657
1123+ #: ../../c-api/memory.rst:658
11241124msgid "free an arena"
11251125msgstr "释放一块区域"
11261126
1127- #: ../../c-api/memory.rst:662
1127+ #: ../../c-api/memory.rst:663
11281128msgid "Get the arena allocator."
11291129msgstr "获取 arena 分配器"
11301130
1131- #: ../../c-api/memory.rst:666
1131+ #: ../../c-api/memory.rst:667
11321132msgid "Set the arena allocator."
11331133msgstr "设置 arena 分配器"
11341134
1135- #: ../../c-api/memory.rst:670
1135+ #: ../../c-api/memory.rst:671
11361136msgid "tracemalloc C API"
11371137msgstr "tracemalloc C API"
11381138
1139- #: ../../c-api/memory.rst:676
1139+ #: ../../c-api/memory.rst:677
11401140msgid "Track an allocated memory block in the :mod:`tracemalloc` module."
11411141msgstr "在 :mod:`tracemalloc` 模块中跟踪一个已分配的内存块。"
11421142
1143- #: ../../c-api/memory.rst:678
1143+ #: ../../c-api/memory.rst:679
11441144msgid ""
11451145"Return ``0`` on success, return ``-1`` on error (failed to allocate memory "
11461146"to store the trace). Return ``-2`` if tracemalloc is disabled."
11471147msgstr ""
11481148"成功时返回 ``0``,出错时返回 ``-1`` (无法分配内存来保存跟踪信息)。 如果禁用了 tracemalloc 则返回 ``-2``。"
11491149
1150- #: ../../c-api/memory.rst:681
1150+ #: ../../c-api/memory.rst:682
11511151msgid "If memory block is already tracked, update the existing trace."
11521152msgstr "如果内存块已被跟踪,则更新现有跟踪信息。"
11531153
1154- #: ../../c-api/memory.rst:685
1154+ #: ../../c-api/memory.rst:686
11551155msgid ""
11561156"Untrack an allocated memory block in the :mod:`tracemalloc` module. Do "
11571157"nothing if the block was not tracked."
11581158msgstr "在 :mod:`tracemalloc` 模块中取消跟踪一个已分配的内存块。 如果内存块未被跟踪则不执行任何操作。"
11591159
1160- #: ../../c-api/memory.rst:688
1160+ #: ../../c-api/memory.rst:689
11611161msgid "Return ``-2`` if tracemalloc is disabled, otherwise return ``0``."
11621162msgstr "如果 tracemalloc 被禁用则返回 ``-2``,否则返回 ``0``。"
11631163
1164- #: ../../c-api/memory.rst:694
1164+ #: ../../c-api/memory.rst:695
11651165msgid "Examples"
11661166msgstr "例子"
11671167
1168- #: ../../c-api/memory.rst:696
1168+ #: ../../c-api/memory.rst:697
11691169msgid ""
11701170"Here is the example from section :ref:`memoryoverview`, rewritten so that "
11711171"the I/O buffer is allocated from the Python heap by using the first function"
11721172" set::"
11731173msgstr ""
11741174"以下是来自 :ref:`memoryoverview` 小节的示例,经过重写以使 I/O 缓冲区是通过使用第一个函数集从 Python 堆中分配的::"
11751175
1176- #: ../../c-api/memory.rst:709
1176+ #: ../../c-api/memory.rst:710
11771177msgid "The same code using the type-oriented function set::"
11781178msgstr "使用面向类型函数集的相同代码::"
11791179
1180- #: ../../c-api/memory.rst:721
1180+ #: ../../c-api/memory.rst:722
11811181msgid ""
11821182"Note that in the two examples above, the buffer is always manipulated via "
11831183"functions belonging to the same set. Indeed, it is required to use the same "
@@ -1190,7 +1190,7 @@ msgstr ""
11901190"族,以便使得混合不同分配器的风险减至最低。 以下代码序列包含两处错误,其中一个被标记为 *fatal* 因为它混合了两种在不同堆上操作的不同分配器。 "
11911191"::"
11921192
1193- #: ../../c-api/memory.rst:736
1193+ #: ../../c-api/memory.rst:737
11941194msgid ""
11951195"In addition to the functions aimed at handling raw memory blocks from the "
11961196"Python heap, objects in Python are allocated and released with "
@@ -1201,7 +1201,7 @@ msgstr ""
12011201":c:macro:`PyObject_New`、:c:macro:`PyObject_NewVar` 和 :c:func:`PyObject_Del` "
12021202"进行分配和释放。"
12031203
1204- #: ../../c-api/memory.rst:740
1204+ #: ../../c-api/memory.rst:741
12051205msgid ""
12061206"These will be explained in the next chapter on defining and implementing new"
12071207" object types in C."
0 commit comments