Skip to content

Commit 5127319

Browse files
sync with cpython 94525a7a
1 parent 840c867 commit 5127319

File tree

2 files changed

+39
-36
lines changed

2 files changed

+39
-36
lines changed

c-api/memory.po

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ msgid ""
88
msgstr ""
99
"Project-Id-Version: Python 3.12\n"
1010
"Report-Msgid-Bugs-To: \n"
11-
"POT-Creation-Date: 2023-08-01 00:03+0000\n"
11+
"POT-Creation-Date: 2023-10-17 00:03+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-"
@@ -557,19 +557,19 @@ msgid ""
557557
"following fields:"
558558
msgstr ""
559559

560-
#: ../../c-api/memory.rst:411 ../../c-api/memory.rst:657
560+
#: ../../c-api/memory.rst:411 ../../c-api/memory.rst:658
561561
msgid "Field"
562562
msgstr ""
563563

564-
#: ../../c-api/memory.rst:411 ../../c-api/memory.rst:657
564+
#: ../../c-api/memory.rst:411 ../../c-api/memory.rst:658
565565
msgid "Meaning"
566566
msgstr ""
567567

568-
#: ../../c-api/memory.rst:413 ../../c-api/memory.rst:659
568+
#: ../../c-api/memory.rst:413 ../../c-api/memory.rst:660
569569
msgid "``void *ctx``"
570570
msgstr "``void *ctx``"
571571

572-
#: ../../c-api/memory.rst:413 ../../c-api/memory.rst:659
572+
#: ../../c-api/memory.rst:413 ../../c-api/memory.rst:660
573573
msgid "user context passed as first argument"
574574
msgstr ""
575575

@@ -938,119 +938,119 @@ msgstr ""
938938
msgid ""
939939
"Python has a *pymalloc* allocator optimized for small objects (smaller or "
940940
"equal to 512 bytes) with a short lifetime. It uses memory mappings called "
941-
"\"arenas\" with a fixed size of 256 KiB. It falls back to :c:func:"
942-
"`PyMem_RawMalloc` and :c:func:`PyMem_RawRealloc` for allocations larger than "
943-
"512 bytes."
941+
"\"arenas\" with a fixed size of either 256 KiB on 32-bit platforms or 1 MiB "
942+
"on 64-bit platforms. It falls back to :c:func:`PyMem_RawMalloc` and :c:func:"
943+
"`PyMem_RawRealloc` for allocations larger than 512 bytes."
944944
msgstr ""
945945

946-
#: ../../c-api/memory.rst:632
946+
#: ../../c-api/memory.rst:633
947947
msgid ""
948948
"*pymalloc* is the :ref:`default allocator <default-memory-allocators>` of "
949949
"the :c:macro:`PYMEM_DOMAIN_MEM` (ex: :c:func:`PyMem_Malloc`) and :c:macro:"
950950
"`PYMEM_DOMAIN_OBJ` (ex: :c:func:`PyObject_Malloc`) domains."
951951
msgstr ""
952952

953-
#: ../../c-api/memory.rst:636
953+
#: ../../c-api/memory.rst:637
954954
msgid "The arena allocator uses the following functions:"
955955
msgstr ""
956956

957-
#: ../../c-api/memory.rst:638
957+
#: ../../c-api/memory.rst:639
958958
msgid ":c:func:`!VirtualAlloc` and :c:func:`!VirtualFree` on Windows,"
959959
msgstr ""
960960

961-
#: ../../c-api/memory.rst:639
961+
#: ../../c-api/memory.rst:640
962962
msgid ":c:func:`!mmap` and :c:func:`!munmap` if available,"
963963
msgstr ""
964964

965-
#: ../../c-api/memory.rst:640
965+
#: ../../c-api/memory.rst:641
966966
msgid ":c:func:`malloc` and :c:func:`free` otherwise."
967967
msgstr ""
968968

969-
#: ../../c-api/memory.rst:642
969+
#: ../../c-api/memory.rst:643
970970
msgid ""
971971
"This allocator is disabled if Python is configured with the :option:`--"
972972
"without-pymalloc` option. It can also be disabled at runtime using the :"
973973
"envvar:`PYTHONMALLOC` environment variable (ex: ``PYTHONMALLOC=malloc``)."
974974
msgstr ""
975975

976-
#: ../../c-api/memory.rst:647
976+
#: ../../c-api/memory.rst:648
977977
msgid "Customize pymalloc Arena Allocator"
978978
msgstr ""
979979

980-
#: ../../c-api/memory.rst:653
980+
#: ../../c-api/memory.rst:654
981981
msgid ""
982982
"Structure used to describe an arena allocator. The structure has three "
983983
"fields:"
984984
msgstr ""
985985

986-
#: ../../c-api/memory.rst:661
986+
#: ../../c-api/memory.rst:662
987987
msgid "``void* alloc(void *ctx, size_t size)``"
988988
msgstr "``void* alloc(void *ctx, size_t size)``"
989989

990-
#: ../../c-api/memory.rst:661
990+
#: ../../c-api/memory.rst:662
991991
msgid "allocate an arena of size bytes"
992992
msgstr ""
993993

994-
#: ../../c-api/memory.rst:663
994+
#: ../../c-api/memory.rst:664
995995
msgid "``void free(void *ctx, void *ptr, size_t size)``"
996996
msgstr "``void free(void *ctx, void *ptr, size_t size)``"
997997

998-
#: ../../c-api/memory.rst:663
998+
#: ../../c-api/memory.rst:664
999999
msgid "free an arena"
10001000
msgstr ""
10011001

1002-
#: ../../c-api/memory.rst:668
1002+
#: ../../c-api/memory.rst:669
10031003
msgid "Get the arena allocator."
10041004
msgstr ""
10051005

1006-
#: ../../c-api/memory.rst:672
1006+
#: ../../c-api/memory.rst:673
10071007
msgid "Set the arena allocator."
10081008
msgstr ""
10091009

1010-
#: ../../c-api/memory.rst:676
1010+
#: ../../c-api/memory.rst:677
10111011
msgid "tracemalloc C API"
10121012
msgstr ""
10131013

1014-
#: ../../c-api/memory.rst:682
1014+
#: ../../c-api/memory.rst:683
10151015
msgid "Track an allocated memory block in the :mod:`tracemalloc` module."
10161016
msgstr ""
10171017

1018-
#: ../../c-api/memory.rst:684
1018+
#: ../../c-api/memory.rst:685
10191019
msgid ""
10201020
"Return ``0`` on success, return ``-1`` on error (failed to allocate memory "
10211021
"to store the trace). Return ``-2`` if tracemalloc is disabled."
10221022
msgstr ""
10231023

1024-
#: ../../c-api/memory.rst:687
1024+
#: ../../c-api/memory.rst:688
10251025
msgid "If memory block is already tracked, update the existing trace."
10261026
msgstr ""
10271027

1028-
#: ../../c-api/memory.rst:691
1028+
#: ../../c-api/memory.rst:692
10291029
msgid ""
10301030
"Untrack an allocated memory block in the :mod:`tracemalloc` module. Do "
10311031
"nothing if the block was not tracked."
10321032
msgstr ""
10331033

1034-
#: ../../c-api/memory.rst:694
1034+
#: ../../c-api/memory.rst:695
10351035
msgid "Return ``-2`` if tracemalloc is disabled, otherwise return ``0``."
10361036
msgstr ""
10371037

1038-
#: ../../c-api/memory.rst:700
1038+
#: ../../c-api/memory.rst:701
10391039
msgid "Examples"
10401040
msgstr "範例"
10411041

1042-
#: ../../c-api/memory.rst:702
1042+
#: ../../c-api/memory.rst:703
10431043
msgid ""
10441044
"Here is the example from section :ref:`memoryoverview`, rewritten so that "
10451045
"the I/O buffer is allocated from the Python heap by using the first function "
10461046
"set::"
10471047
msgstr ""
10481048

1049-
#: ../../c-api/memory.rst:715
1049+
#: ../../c-api/memory.rst:716
10501050
msgid "The same code using the type-oriented function set::"
10511051
msgstr ""
10521052

1053-
#: ../../c-api/memory.rst:727
1053+
#: ../../c-api/memory.rst:728
10541054
msgid ""
10551055
"Note that in the two examples above, the buffer is always manipulated via "
10561056
"functions belonging to the same set. Indeed, it is required to use the same "
@@ -1060,14 +1060,14 @@ msgid ""
10601060
"different allocators operating on different heaps. ::"
10611061
msgstr ""
10621062

1063-
#: ../../c-api/memory.rst:742
1063+
#: ../../c-api/memory.rst:743
10641064
msgid ""
10651065
"In addition to the functions aimed at handling raw memory blocks from the "
10661066
"Python heap, objects in Python are allocated and released with :c:macro:"
10671067
"`PyObject_New`, :c:macro:`PyObject_NewVar` and :c:func:`PyObject_Del`."
10681068
msgstr ""
10691069

1070-
#: ../../c-api/memory.rst:746
1070+
#: ../../c-api/memory.rst:747
10711071
msgid ""
10721072
"These will be explained in the next chapter on defining and implementing new "
10731073
"object types in C."

c-api/set.po

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ msgid ""
77
msgstr ""
88
"Project-Id-Version: Python 3.12\n"
99
"Report-Msgid-Bugs-To: \n"
10-
"POT-Creation-Date: 2023-07-29 00:03+0000\n"
10+
"POT-Creation-Date: 2023-10-17 00:03+0000\n"
1111
"PO-Revision-Date: 2018-05-23 14:07+0000\n"
1212
"Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n"
1313
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
@@ -182,7 +182,10 @@ msgid ""
182182
msgstr ""
183183

184184
#: ../../c-api/set.rst:166
185-
msgid "Empty an existing set of all elements."
185+
msgid ""
186+
"Empty an existing set of all elements. Return ``0`` on success. Return "
187+
"``-1`` and raise :exc:`SystemError` if *set* is not an instance of :class:"
188+
"`set` or its subtype."
186189
msgstr ""
187190

188191
#: ../../c-api/set.rst:11

0 commit comments

Comments
 (0)