88msgstr ""
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 <[email protected] >\n "
1414"Language-Team : Chinese - TAIWAN (https://github.com/python/python-docs-zh- "
@@ -587,19 +587,19 @@ msgid ""
587587"following fields:"
588588msgstr ""
589589
590- #: ../../c-api/memory.rst:423 ../../c-api/memory.rst:670
590+ #: ../../c-api/memory.rst:423 ../../c-api/memory.rst:674
591591msgid "Field"
592592msgstr "欄位"
593593
594- #: ../../c-api/memory.rst:423 ../../c-api/memory.rst:670
594+ #: ../../c-api/memory.rst:423 ../../c-api/memory.rst:674
595595msgid "Meaning"
596596msgstr "意義"
597597
598- #: ../../c-api/memory.rst:425 ../../c-api/memory.rst:672
598+ #: ../../c-api/memory.rst:425 ../../c-api/memory.rst:676
599599msgid "``void *ctx``"
600600msgstr "``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
603603msgid "user context passed as first argument"
604604msgstr ""
605605
@@ -1003,92 +1003,99 @@ msgid ""
10031003"envvar:`PYTHONMALLOC` environment variable (ex: ``PYTHONMALLOC=malloc``)."
10041004msgstr ""
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
10071014msgid "Customize pymalloc Arena Allocator"
10081015msgstr ""
10091016
1010- #: ../../c-api/memory.rst:666
1017+ #: ../../c-api/memory.rst:670
10111018msgid ""
10121019"Structure used to describe an arena allocator. The structure has three "
10131020"fields:"
10141021msgstr ""
10151022
1016- #: ../../c-api/memory.rst:674
1023+ #: ../../c-api/memory.rst:678
10171024msgid "``void* alloc(void *ctx, size_t size)``"
10181025msgstr "``void* alloc(void *ctx, size_t size)``"
10191026
1020- #: ../../c-api/memory.rst:674
1027+ #: ../../c-api/memory.rst:678
10211028msgid "allocate an arena of size bytes"
10221029msgstr ""
10231030
1024- #: ../../c-api/memory.rst:676
1031+ #: ../../c-api/memory.rst:680
10251032msgid "``void free(void *ctx, void *ptr, size_t size)``"
10261033msgstr "``void free(void *ctx, void *ptr, size_t size)``"
10271034
1028- #: ../../c-api/memory.rst:676
1035+ #: ../../c-api/memory.rst:680
10291036msgid "free an arena"
10301037msgstr ""
10311038
1032- #: ../../c-api/memory.rst:681
1039+ #: ../../c-api/memory.rst:685
10331040msgid "Get the arena allocator."
10341041msgstr ""
10351042
1036- #: ../../c-api/memory.rst:685
1043+ #: ../../c-api/memory.rst:689
10371044msgid "Set the arena allocator."
10381045msgstr ""
10391046
1040- #: ../../c-api/memory.rst:690
1047+ #: ../../c-api/memory.rst:694
10411048msgid "The mimalloc allocator"
10421049msgstr ""
10431050
1044- #: ../../c-api/memory.rst:694
1051+ #: ../../c-api/memory.rst:698
10451052msgid ""
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.\" "
10501057msgstr ""
10511058
1052- #: ../../c-api/memory.rst:699
1059+ #: ../../c-api/memory.rst:703
10531060msgid "tracemalloc C API"
10541061msgstr ""
10551062
1056- #: ../../c-api/memory.rst:705
1063+ #: ../../c-api/memory.rst:709
10571064msgid "Track an allocated memory block in the :mod:`tracemalloc` module."
10581065msgstr ""
10591066
1060- #: ../../c-api/memory.rst:707
1067+ #: ../../c-api/memory.rst:711
10611068msgid ""
10621069"Return ``0`` on success, return ``-1`` on error (failed to allocate memory "
10631070"to store the trace). Return ``-2`` if tracemalloc is disabled."
10641071msgstr ""
10651072
1066- #: ../../c-api/memory.rst:710
1073+ #: ../../c-api/memory.rst:714
10671074msgid "If memory block is already tracked, update the existing trace."
10681075msgstr ""
10691076
1070- #: ../../c-api/memory.rst:714
1077+ #: ../../c-api/memory.rst:718
10711078msgid ""
10721079"Untrack an allocated memory block in the :mod:`tracemalloc` module. Do "
10731080"nothing if the block was not tracked."
10741081msgstr ""
10751082
1076- #: ../../c-api/memory.rst:717
1083+ #: ../../c-api/memory.rst:721
10771084msgid "Return ``-2`` if tracemalloc is disabled, otherwise return ``0``."
10781085msgstr ""
10791086
1080- #: ../../c-api/memory.rst:723
1087+ #: ../../c-api/memory.rst:727
10811088msgid "Examples"
10821089msgstr "範例"
10831090
1084- #: ../../c-api/memory.rst:725
1091+ #: ../../c-api/memory.rst:729
10851092msgid ""
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::"
10891096msgstr ""
10901097
1091- #: ../../c-api/memory.rst:728
1098+ #: ../../c-api/memory.rst:732
10921099msgid ""
10931100"PyObject *res;\n"
10941101"char *buf = (char *) PyMem_Malloc(BUFSIZ); /* for I/O */\n"
@@ -1101,11 +1108,11 @@ msgid ""
11011108"return res;"
11021109msgstr ""
11031110
1104- #: ../../c-api/memory.rst:738
1111+ #: ../../c-api/memory.rst:742
11051112msgid "The same code using the type-oriented function set::"
11061113msgstr ""
11071114
1108- #: ../../c-api/memory.rst:740
1115+ #: ../../c-api/memory.rst:744
11091116msgid ""
11101117"PyObject *res;\n"
11111118"char *buf = PyMem_New(char, BUFSIZ); /* for I/O */\n"
@@ -1118,7 +1125,7 @@ msgid ""
11181125"return res;"
11191126msgstr ""
11201127
1121- #: ../../c-api/memory.rst:750
1128+ #: ../../c-api/memory.rst:754
11221129msgid ""
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. ::"
11291136msgstr ""
11301137
1131- #: ../../c-api/memory.rst:757
1138+ #: ../../c-api/memory.rst:761
11321139msgid ""
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() */"
11401147msgstr ""
11411148
1142- #: ../../c-api/memory.rst:765
1149+ #: ../../c-api/memory.rst:769
11431150msgid ""
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`."
11471154msgstr ""
11481155
1149- #: ../../c-api/memory.rst:769
1156+ #: ../../c-api/memory.rst:773
11501157msgid ""
11511158"These will be explained in the next chapter on defining and implementing new "
11521159"object types in C."
0 commit comments