Skip to content

Commit 63492af

Browse files
committed
feat: translate c-api/allocation.po
1 parent fdd778f commit 63492af

File tree

1 file changed

+29
-4
lines changed

1 file changed

+29
-4
lines changed

c-api/allocation.po

+29-4
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,28 @@
33
# This file is distributed under the same license as the Python package.
44
#
55
# Translators:
6+
# Liang-Bo Wang <[email protected]>, 2016
7+
# Matt Wang <[email protected]>, 2021
8+
#
69
msgid ""
710
msgstr ""
811
"Project-Id-Version: Python 3.11\n"
912
"Report-Msgid-Bugs-To: \n"
1013
"POT-Creation-Date: 2022-07-06 00:17+0000\n"
11-
"PO-Revision-Date: 2016-01-31 07:06+0000\n"
12-
"Last-Translator: Liang-Bo Wang <[email protected]>\n"
14+
"PO-Revision-Date: 2021-12-16 15:39+0800\n"
15+
"Last-Translator: Matt Wang <[email protected]>\n"
1316
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
1417
"tw)\n"
1518
"Language: zh_TW\n"
1619
"MIME-Version: 1.0\n"
1720
"Content-Type: text/plain; charset=UTF-8\n"
1821
"Content-Transfer-Encoding: 8bit\n"
1922
"Plural-Forms: nplurals=1; plural=0;\n"
23+
"X-Generator: Poedit 3.0.1\n"
2024

2125
#: ../../c-api/allocation.rst:6
2226
msgid "Allocating Objects on the Heap"
23-
msgstr ""
27+
msgstr "在 heap 上分配物件"
2428

2529
#: ../../c-api/allocation.rst:17
2630
msgid ""
@@ -30,12 +34,17 @@ msgid ""
3034
"detector's set of observed objects. Other fields of the object are not "
3135
"affected."
3236
msgstr ""
37+
"用它的型別和初始參照來初始化新分配物件 *op*\\ 。已初始化的物件會被回傳。如果 "
38+
"*type* 表示了該物件參與迴圈垃圾檢查器,則將其新增到檢查器的觀察物件集合中。物"
39+
"件的其他欄位不受影響。"
3340

3441
#: ../../c-api/allocation.rst:26
3542
msgid ""
3643
"This does everything :c:func:`PyObject_Init` does, and also initializes the "
3744
"length information for a variable-size object."
3845
msgstr ""
46+
"它會做到 :c:func:`PyObject_Init` 的所有功能,並且會初始化一個大小可變物件的長"
47+
"度資訊。"
3948

4049
#: ../../c-api/allocation.rst:32
4150
msgid ""
@@ -45,6 +54,10 @@ msgid ""
4554
"the memory allocation is determined from the :c:member:`~PyTypeObject."
4655
"tp_basicsize` field of the type object."
4756
msgstr ""
57+
"使用 C 結構型別 *TYPE* 和 Python 型別物件 *type* 分配一個新的 Python 物件。未"
58+
"在該 Python 物件標頭 (header) 中定義的欄位不會被初始化;物件的參照計數將為"
59+
"一。記憶體分配大小由 type 物件的 :c:member:`~PyTypeObject.tp_basicsize` 欄位"
60+
"來指定。"
4861

4962
#: ../../c-api/allocation.rst:41
5063
msgid ""
@@ -57,6 +70,12 @@ msgid ""
5770
"Embedding the array of fields into the same allocation decreases the number "
5871
"of allocations, improving the memory management efficiency."
5972
msgstr ""
73+
"使用 C 的結構型別 *TYPE* 和 Python 的型別物件 *type* 分配一個新的 Python 物"
74+
"件。未在該 Python 物件標頭中定義的欄位不會被初始化。記憶體空間預留了 *TYPE* "
75+
"結構大小再加上 *type* 物件中 :c:member:`~PyTypeObject.tp_itemsize` 欄位提供"
76+
"的 *size* 欄位的值。這對於實現如 tuple 這種能夠在建立期間決定自己大小的物件是"
77+
"很實用的。將欄位的陣列嵌入到相同的記憶體分配中可以減少記憶體分配的次數,這提"
78+
"高了記憶體管理的效率。"
6079

6180
#: ../../c-api/allocation.rst:53
6281
msgid ""
@@ -66,18 +85,24 @@ msgid ""
6685
"fields of the object should not be accessed after this call as the memory is "
6786
"no longer a valid Python object."
6887
msgstr ""
88+
"釋放由 :c:func:`PyObject_New` 或者 :c:func:`PyObject_NewVar` 分配給物件的記憶"
89+
"體。這通常是在物件型別所指定的 :c:member:`~PyTypeObject.tp_dealloc` handler "
90+
"中呼叫。呼叫這個函式以後,物件的各欄位都不可以被存取,因為原本分配的記憶體已"
91+
"不再是一個有效的 Python 物件。"
6992

7093
#: ../../c-api/allocation.rst:62
7194
msgid ""
7295
"Object which is visible in Python as ``None``. This should only be accessed "
7396
"using the :c:macro:`Py_None` macro, which evaluates to a pointer to this "
7497
"object."
7598
msgstr ""
99+
"這個物件像是 Python 中的 ``None``\\ 。它只應該透過 :c:macro:`Py_None` 巨集來"
100+
"存取,該巨集的拿到指向該物件的指標。"
76101

77102
#: ../../c-api/allocation.rst:69
78103
msgid ":c:func:`PyModule_Create`"
79104
msgstr ":c:func:`PyModule_Create`"
80105

81106
#: ../../c-api/allocation.rst:70
82107
msgid "To allocate and create extension modules."
83-
msgstr ""
108+
msgstr "分配記憶體和建立擴充模組。"

0 commit comments

Comments
 (0)