Skip to content

Commit a8c0d8e

Browse files
pydoc-zh-tw[bot]github-actions[bot]mattwang44
authored
Sync with CPython 3.13 (#1123)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Matt Wang <mattwang44@gmail.com>
1 parent 6c367bc commit a8c0d8e

22 files changed

+3515
-3147
lines changed

c-api/memory.po

Lines changed: 37 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ msgid ""
88
msgstr ""
99
"Project-Id-Version: Python 3.13\n"
1010
"Report-Msgid-Bugs-To: \n"
11-
"POT-Creation-Date: 2024-09-24 07:20+0000\n"
11+
"POT-Creation-Date: 2025-07-21 00:18+0000\n"
1212
"PO-Revision-Date: 2018-05-23 14:06+0000\n"
1313
"Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n"
1414
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
@@ -587,19 +587,19 @@ msgid ""
587587
"following fields:"
588588
msgstr ""
589589

590-
#: ../../c-api/memory.rst:423 ../../c-api/memory.rst:670
590+
#: ../../c-api/memory.rst:423 ../../c-api/memory.rst:674
591591
msgid "Field"
592592
msgstr "欄位"
593593

594-
#: ../../c-api/memory.rst:423 ../../c-api/memory.rst:670
594+
#: ../../c-api/memory.rst:423 ../../c-api/memory.rst:674
595595
msgid "Meaning"
596596
msgstr "意義"
597597

598-
#: ../../c-api/memory.rst:425 ../../c-api/memory.rst:672
598+
#: ../../c-api/memory.rst:425 ../../c-api/memory.rst:676
599599
msgid "``void *ctx``"
600600
msgstr "``void *ctx``"
601601

602-
#: ../../c-api/memory.rst:425 ../../c-api/memory.rst:672
602+
#: ../../c-api/memory.rst:425 ../../c-api/memory.rst:676
603603
msgid "user context passed as first argument"
604604
msgstr ""
605605

@@ -1003,92 +1003,99 @@ msgid ""
10031003
"envvar:`PYTHONMALLOC` environment variable (ex: ``PYTHONMALLOC=malloc``)."
10041004
msgstr ""
10051005

1006-
#: ../../c-api/memory.rst:660
1006+
#: ../../c-api/memory.rst:659
1007+
msgid ""
1008+
"Typically, it makes sense to disable the pymalloc allocator when building "
1009+
"Python with AddressSanitizer (:option:`--with-address-sanitizer`) which "
1010+
"helps uncover low level bugs within the C code."
1011+
msgstr ""
1012+
1013+
#: ../../c-api/memory.rst:664
10071014
msgid "Customize pymalloc Arena Allocator"
10081015
msgstr ""
10091016

1010-
#: ../../c-api/memory.rst:666
1017+
#: ../../c-api/memory.rst:670
10111018
msgid ""
10121019
"Structure used to describe an arena allocator. The structure has three "
10131020
"fields:"
10141021
msgstr ""
10151022

1016-
#: ../../c-api/memory.rst:674
1023+
#: ../../c-api/memory.rst:678
10171024
msgid "``void* alloc(void *ctx, size_t size)``"
10181025
msgstr "``void* alloc(void *ctx, size_t size)``"
10191026

1020-
#: ../../c-api/memory.rst:674
1027+
#: ../../c-api/memory.rst:678
10211028
msgid "allocate an arena of size bytes"
10221029
msgstr ""
10231030

1024-
#: ../../c-api/memory.rst:676
1031+
#: ../../c-api/memory.rst:680
10251032
msgid "``void free(void *ctx, void *ptr, size_t size)``"
10261033
msgstr "``void free(void *ctx, void *ptr, size_t size)``"
10271034

1028-
#: ../../c-api/memory.rst:676
1035+
#: ../../c-api/memory.rst:680
10291036
msgid "free an arena"
10301037
msgstr ""
10311038

1032-
#: ../../c-api/memory.rst:681
1039+
#: ../../c-api/memory.rst:685
10331040
msgid "Get the arena allocator."
10341041
msgstr ""
10351042

1036-
#: ../../c-api/memory.rst:685
1043+
#: ../../c-api/memory.rst:689
10371044
msgid "Set the arena allocator."
10381045
msgstr ""
10391046

1040-
#: ../../c-api/memory.rst:690
1047+
#: ../../c-api/memory.rst:694
10411048
msgid "The mimalloc allocator"
10421049
msgstr ""
10431050

1044-
#: ../../c-api/memory.rst:694
1051+
#: ../../c-api/memory.rst:698
10451052
msgid ""
10461053
"Python supports the mimalloc allocator when the underlying platform support "
10471054
"is available. mimalloc \"is a general purpose allocator with excellent "
10481055
"performance characteristics. Initially developed by Daan Leijen for the "
10491056
"runtime systems of the Koka and Lean languages.\""
10501057
msgstr ""
10511058

1052-
#: ../../c-api/memory.rst:699
1059+
#: ../../c-api/memory.rst:703
10531060
msgid "tracemalloc C API"
10541061
msgstr ""
10551062

1056-
#: ../../c-api/memory.rst:705
1063+
#: ../../c-api/memory.rst:709
10571064
msgid "Track an allocated memory block in the :mod:`tracemalloc` module."
10581065
msgstr ""
10591066

1060-
#: ../../c-api/memory.rst:707
1067+
#: ../../c-api/memory.rst:711
10611068
msgid ""
10621069
"Return ``0`` on success, return ``-1`` on error (failed to allocate memory "
10631070
"to store the trace). Return ``-2`` if tracemalloc is disabled."
10641071
msgstr ""
10651072

1066-
#: ../../c-api/memory.rst:710
1073+
#: ../../c-api/memory.rst:714
10671074
msgid "If memory block is already tracked, update the existing trace."
10681075
msgstr ""
10691076

1070-
#: ../../c-api/memory.rst:714
1077+
#: ../../c-api/memory.rst:718
10711078
msgid ""
10721079
"Untrack an allocated memory block in the :mod:`tracemalloc` module. Do "
10731080
"nothing if the block was not tracked."
10741081
msgstr ""
10751082

1076-
#: ../../c-api/memory.rst:717
1083+
#: ../../c-api/memory.rst:721
10771084
msgid "Return ``-2`` if tracemalloc is disabled, otherwise return ``0``."
10781085
msgstr ""
10791086

1080-
#: ../../c-api/memory.rst:723
1087+
#: ../../c-api/memory.rst:727
10811088
msgid "Examples"
10821089
msgstr "範例"
10831090

1084-
#: ../../c-api/memory.rst:725
1091+
#: ../../c-api/memory.rst:729
10851092
msgid ""
10861093
"Here is the example from section :ref:`memoryoverview`, rewritten so that "
10871094
"the I/O buffer is allocated from the Python heap by using the first function "
10881095
"set::"
10891096
msgstr ""
10901097

1091-
#: ../../c-api/memory.rst:728
1098+
#: ../../c-api/memory.rst:732
10921099
msgid ""
10931100
"PyObject *res;\n"
10941101
"char *buf = (char *) PyMem_Malloc(BUFSIZ); /* for I/O */\n"
@@ -1101,11 +1108,11 @@ msgid ""
11011108
"return res;"
11021109
msgstr ""
11031110

1104-
#: ../../c-api/memory.rst:738
1111+
#: ../../c-api/memory.rst:742
11051112
msgid "The same code using the type-oriented function set::"
11061113
msgstr ""
11071114

1108-
#: ../../c-api/memory.rst:740
1115+
#: ../../c-api/memory.rst:744
11091116
msgid ""
11101117
"PyObject *res;\n"
11111118
"char *buf = PyMem_New(char, BUFSIZ); /* for I/O */\n"
@@ -1118,7 +1125,7 @@ msgid ""
11181125
"return res;"
11191126
msgstr ""
11201127

1121-
#: ../../c-api/memory.rst:750
1128+
#: ../../c-api/memory.rst:754
11221129
msgid ""
11231130
"Note that in the two examples above, the buffer is always manipulated via "
11241131
"functions belonging to the same set. Indeed, it is required to use the same "
@@ -1128,7 +1135,7 @@ msgid ""
11281135
"different allocators operating on different heaps. ::"
11291136
msgstr ""
11301137

1131-
#: ../../c-api/memory.rst:757
1138+
#: ../../c-api/memory.rst:761
11321139
msgid ""
11331140
"char *buf1 = PyMem_New(char, BUFSIZ);\n"
11341141
"char *buf2 = (char *) malloc(BUFSIZ);\n"
@@ -1139,14 +1146,14 @@ msgid ""
11391146
"free(buf1); /* Fatal -- should be PyMem_Del() */"
11401147
msgstr ""
11411148

1142-
#: ../../c-api/memory.rst:765
1149+
#: ../../c-api/memory.rst:769
11431150
msgid ""
11441151
"In addition to the functions aimed at handling raw memory blocks from the "
11451152
"Python heap, objects in Python are allocated and released with :c:macro:"
11461153
"`PyObject_New`, :c:macro:`PyObject_NewVar` and :c:func:`PyObject_Del`."
11471154
msgstr ""
11481155

1149-
#: ../../c-api/memory.rst:769
1156+
#: ../../c-api/memory.rst:773
11501157
msgid ""
11511158
"These will be explained in the next chapter on defining and implementing new "
11521159
"object types in C."

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy