@@ -16,7 +16,7 @@ msgid ""
1616msgstr ""
1717"Project-Id-Version : Python 3.12\n "
1818"Report-Msgid-Bugs-To : \n "
19- "POT-Creation-Date : 2023-08-04 14:13+0000\n "
19+ "POT-Creation-Date : 2023-10-20 14:13+0000\n "
2020"PO-Revision-Date : 2021-06-28 00:49+0000\n "
2121"
Last-Translator :
Freesand Leo <[email protected] >, 2023\n "
2222"Language-Team : Chinese (China) (https://app.transifex.com/python-doc/teams/5390/zh_CN/)\n "
@@ -639,19 +639,19 @@ msgid ""
639639"following fields:"
640640msgstr "用于描述内存块分配器的结构体。 该结构体下列字段:"
641641
642- #: ../../c-api/memory.rst:411 ../../c-api/memory.rst:657
642+ #: ../../c-api/memory.rst:411 ../../c-api/memory.rst:658
643643msgid "Field"
644644msgstr "域"
645645
646- #: ../../c-api/memory.rst:411 ../../c-api/memory.rst:657
646+ #: ../../c-api/memory.rst:411 ../../c-api/memory.rst:658
647647msgid "Meaning"
648648msgstr "含意"
649649
650- #: ../../c-api/memory.rst:413 ../../c-api/memory.rst:659
650+ #: ../../c-api/memory.rst:413 ../../c-api/memory.rst:660
651651msgid "``void *ctx``"
652652msgstr "``void *ctx``"
653653
654- #: ../../c-api/memory.rst:413 ../../c-api/memory.rst:659
654+ #: ../../c-api/memory.rst:413 ../../c-api/memory.rst:660
655655msgid "user context passed as first argument"
656656msgstr "作为第一个参数传入的用户上下文"
657657
@@ -1070,15 +1070,12 @@ msgstr "pymalloc 分配器"
10701070msgid ""
10711071"Python has a *pymalloc* allocator optimized for small objects (smaller or "
10721072"equal to 512 bytes) with a short lifetime. It uses memory mappings called "
1073- "\" arenas\" with a fixed size of 256 KiB. It falls back to "
1074- ":c:func:`PyMem_RawMalloc` and :c:func:`PyMem_RawRealloc` for allocations "
1075- "larger than 512 bytes."
1073+ "\" arenas\" with a fixed size of either 256 KiB on 32-bit platforms or 1 MiB "
1074+ "on 64-bit platforms. It falls back to :c:func:`PyMem_RawMalloc` and "
1075+ ":c:func:`PyMem_RawRealloc` for allocations larger than 512 bytes."
10761076msgstr ""
1077- "Python 有为具有短生命周期的小对象(小于或等于 512 字节)优化的 *pymalloc* 分配器。它使用固定大小为 256 KiB 的称为 "
1078- "\" arenas\" 的内存映射。对于大于512字节的分配,它回到使用 :c:func:`PyMem_RawMalloc` 和 "
1079- ":c:func:`PyMem_RawRealloc` 。"
10801077
1081- #: ../../c-api/memory.rst:632
1078+ #: ../../c-api/memory.rst:633
10821079msgid ""
10831080"*pymalloc* is the :ref:`default allocator <default-memory-allocators>` of "
10841081"the :c:macro:`PYMEM_DOMAIN_MEM` (ex: :c:func:`PyMem_Malloc`) and "
@@ -1088,23 +1085,23 @@ msgstr ""
10881085":c:macro:`PYMEM_DOMAIN_OBJ` (例如: :c:func:`PyObject_Malloc`) 域的 :ref:`默认分配器 "
10891086"<default-memory-allocators>`。"
10901087
1091- #: ../../c-api/memory.rst:636
1088+ #: ../../c-api/memory.rst:637
10921089msgid "The arena allocator uses the following functions:"
10931090msgstr "arena 分配器使用以下函数:"
10941091
1095- #: ../../c-api/memory.rst:638
1092+ #: ../../c-api/memory.rst:639
10961093msgid ":c:func:`!VirtualAlloc` and :c:func:`!VirtualFree` on Windows,"
10971094msgstr "Windows 上的 :c:func:`!VirtualAlloc` 和 :c:func:`!VirtualFree`,"
10981095
1099- #: ../../c-api/memory.rst:639
1096+ #: ../../c-api/memory.rst:640
11001097msgid ":c:func:`!mmap` and :c:func:`!munmap` if available,"
11011098msgstr ":c:func:`!mmap` 和 :c:func:`!munmap`,如果可用的话,"
11021099
1103- #: ../../c-api/memory.rst:640
1100+ #: ../../c-api/memory.rst:641
11041101msgid ":c:func:`malloc` and :c:func:`free` otherwise."
11051102msgstr "否则, :c:func:`malloc` 和 :c:func:`free` 。"
11061103
1107- #: ../../c-api/memory.rst:642
1104+ #: ../../c-api/memory.rst:643
11081105msgid ""
11091106"This allocator is disabled if Python is configured with the "
11101107":option:`--without-pymalloc` option. It can also be disabled at runtime "
@@ -1114,86 +1111,86 @@ msgstr ""
11141111"如果 Python 配置了 :option:`--without-pymalloc` 选项,那么此分配器将被禁用。也可以在运行时使用 "
11151112":envvar:`PYTHONMALLOC`(例如:``PYTHONMALLOC=malloc``)环境变量来禁用它。"
11161113
1117- #: ../../c-api/memory.rst:647
1114+ #: ../../c-api/memory.rst:648
11181115msgid "Customize pymalloc Arena Allocator"
11191116msgstr "自定义 pymalloc Arena 分配器"
11201117
1121- #: ../../c-api/memory.rst:653
1118+ #: ../../c-api/memory.rst:654
11221119msgid ""
11231120"Structure used to describe an arena allocator. The structure has three "
11241121"fields:"
11251122msgstr "用来描述一个 arena 分配器的结构体。这个结构体有三个字段:"
11261123
1127- #: ../../c-api/memory.rst:661
1124+ #: ../../c-api/memory.rst:662
11281125msgid "``void* alloc(void *ctx, size_t size)``"
11291126msgstr "``void* alloc(void *ctx, size_t size)``"
11301127
1131- #: ../../c-api/memory.rst:661
1128+ #: ../../c-api/memory.rst:662
11321129msgid "allocate an arena of size bytes"
11331130msgstr "分配一块 size 字节的区域"
11341131
1135- #: ../../c-api/memory.rst:663
1132+ #: ../../c-api/memory.rst:664
11361133msgid "``void free(void *ctx, void *ptr, size_t size)``"
11371134msgstr "``void free(void *ctx, void *ptr, size_t size)``"
11381135
1139- #: ../../c-api/memory.rst:663
1136+ #: ../../c-api/memory.rst:664
11401137msgid "free an arena"
11411138msgstr "释放一块区域"
11421139
1143- #: ../../c-api/memory.rst:668
1140+ #: ../../c-api/memory.rst:669
11441141msgid "Get the arena allocator."
11451142msgstr "获取 arena 分配器"
11461143
1147- #: ../../c-api/memory.rst:672
1144+ #: ../../c-api/memory.rst:673
11481145msgid "Set the arena allocator."
11491146msgstr "设置 arena 分配器"
11501147
1151- #: ../../c-api/memory.rst:676
1148+ #: ../../c-api/memory.rst:677
11521149msgid "tracemalloc C API"
11531150msgstr "tracemalloc C API"
11541151
1155- #: ../../c-api/memory.rst:682
1152+ #: ../../c-api/memory.rst:683
11561153msgid "Track an allocated memory block in the :mod:`tracemalloc` module."
11571154msgstr "在 :mod:`tracemalloc` 模块中跟踪一个已分配的内存块。"
11581155
1159- #: ../../c-api/memory.rst:684
1156+ #: ../../c-api/memory.rst:685
11601157msgid ""
11611158"Return ``0`` on success, return ``-1`` on error (failed to allocate memory "
11621159"to store the trace). Return ``-2`` if tracemalloc is disabled."
11631160msgstr ""
11641161"成功时返回 ``0``,出错时返回 ``-1`` (无法分配内存来保存跟踪信息)。 如果禁用了 tracemalloc 则返回 ``-2``。"
11651162
1166- #: ../../c-api/memory.rst:687
1163+ #: ../../c-api/memory.rst:688
11671164msgid "If memory block is already tracked, update the existing trace."
11681165msgstr "如果内存块已被跟踪,则更新现有跟踪信息。"
11691166
1170- #: ../../c-api/memory.rst:691
1167+ #: ../../c-api/memory.rst:692
11711168msgid ""
11721169"Untrack an allocated memory block in the :mod:`tracemalloc` module. Do "
11731170"nothing if the block was not tracked."
11741171msgstr "在 :mod:`tracemalloc` 模块中取消跟踪一个已分配的内存块。 如果内存块未被跟踪则不执行任何操作。"
11751172
1176- #: ../../c-api/memory.rst:694
1173+ #: ../../c-api/memory.rst:695
11771174msgid "Return ``-2`` if tracemalloc is disabled, otherwise return ``0``."
11781175msgstr "如果 tracemalloc 被禁用则返回 ``-2``,否则返回 ``0``。"
11791176
1180- #: ../../c-api/memory.rst:700
1177+ #: ../../c-api/memory.rst:701
11811178msgid "Examples"
11821179msgstr "例子"
11831180
1184- #: ../../c-api/memory.rst:702
1181+ #: ../../c-api/memory.rst:703
11851182msgid ""
11861183"Here is the example from section :ref:`memoryoverview`, rewritten so that "
11871184"the I/O buffer is allocated from the Python heap by using the first function"
11881185" set::"
11891186msgstr ""
11901187"以下是来自 :ref:`memoryoverview` 小节的示例,经过重写以使 I/O 缓冲区是通过使用第一个函数集从 Python 堆中分配的::"
11911188
1192- #: ../../c-api/memory.rst:715
1189+ #: ../../c-api/memory.rst:716
11931190msgid "The same code using the type-oriented function set::"
11941191msgstr "使用面向类型函数集的相同代码::"
11951192
1196- #: ../../c-api/memory.rst:727
1193+ #: ../../c-api/memory.rst:728
11971194msgid ""
11981195"Note that in the two examples above, the buffer is always manipulated via "
11991196"functions belonging to the same set. Indeed, it is required to use the same "
@@ -1206,7 +1203,7 @@ msgstr ""
12061203"族,以便使得混合不同分配器的风险减至最低。 以下代码序列包含两处错误,其中一个被标记为 *fatal* 因为它混合了两种在不同堆上操作的不同分配器。 "
12071204"::"
12081205
1209- #: ../../c-api/memory.rst:742
1206+ #: ../../c-api/memory.rst:743
12101207msgid ""
12111208"In addition to the functions aimed at handling raw memory blocks from the "
12121209"Python heap, objects in Python are allocated and released with "
@@ -1217,7 +1214,7 @@ msgstr ""
12171214":c:macro:`PyObject_New`、:c:macro:`PyObject_NewVar` 和 :c:func:`PyObject_Del` "
12181215"进行分配和释放。"
12191216
1220- #: ../../c-api/memory.rst:746
1217+ #: ../../c-api/memory.rst:747
12211218msgid ""
12221219"These will be explained in the next chapter on defining and implementing new"
12231220" object types in C."
0 commit comments