@@ -16,7 +16,7 @@ msgid ""
1616msgstr ""
1717"Project-Id-Version : Python 3.7\n "
1818"Report-Msgid-Bugs-To : \n "
19- "POT-Creation-Date : 2019-01-01 10:14 +0900\n "
19+ "POT-Creation-Date : 2019-04-12 11:10 +0900\n "
2020"PO-Revision-Date : 2017-02-16 17:37+0000\n "
2121"
Last-Translator :
Shengjing Zhu <[email protected] >, 2019\n "
2222"Language-Team : Chinese (China) (https://www.transifex.com/python-doc/teams/5390/zh_CN/)\n "
@@ -502,19 +502,19 @@ msgid ""
502502"fields:"
503503msgstr ""
504504
505- #: ../../c-api/memory.rst:368 ../../c-api/memory.rst:506
505+ #: ../../c-api/memory.rst:368 ../../c-api/memory.rst:513
506506msgid "Field"
507507msgstr ""
508508
509- #: ../../c-api/memory.rst:368 ../../c-api/memory.rst:506
509+ #: ../../c-api/memory.rst:368 ../../c-api/memory.rst:513
510510msgid "Meaning"
511511msgstr "意义"
512512
513- #: ../../c-api/memory.rst:370 ../../c-api/memory.rst:508
513+ #: ../../c-api/memory.rst:370 ../../c-api/memory.rst:515
514514msgid "``void *ctx``"
515515msgstr ""
516516
517- #: ../../c-api/memory.rst:370 ../../c-api/memory.rst:508
517+ #: ../../c-api/memory.rst:370 ../../c-api/memory.rst:515
518518msgid "user context passed as first argument"
519519msgstr ""
520520
@@ -647,52 +647,53 @@ msgstr ""
647647
648648#: ../../c-api/memory.rst:443
649649msgid ""
650- "Newly allocated memory is filled with the byte ``0xCB``, freed memory is "
651- "filled with the byte ``0xDB``."
650+ "Newly allocated memory is filled with the byte ``0xCD`` (``CLEANBYTE``), "
651+ "freed memory is filled with the byte ``0xDD`` (``DEADBYTE``). Memory blocks "
652+ "are surrounded by \" forbidden bytes\" (``FORBIDDENBYTE``: byte ``0xFD``)."
652653msgstr ""
653654
654- #: ../../c-api/memory.rst:446
655+ #: ../../c-api/memory.rst:447
655656msgid "Runtime checks:"
656657msgstr ""
657658
658- #: ../../c-api/memory.rst:448
659+ #: ../../c-api/memory.rst:449
659660msgid ""
660661"Detect API violations, ex: :c:func:`PyObject_Free` called on a buffer "
661662"allocated by :c:func:`PyMem_Malloc`"
662663msgstr ""
663664
664- #: ../../c-api/memory.rst:450
665+ #: ../../c-api/memory.rst:451
665666msgid "Detect write before the start of the buffer (buffer underflow)"
666667msgstr ""
667668
668- #: ../../c-api/memory.rst:451
669+ #: ../../c-api/memory.rst:452
669670msgid "Detect write after the end of the buffer (buffer overflow)"
670671msgstr ""
671672
672- #: ../../c-api/memory.rst:452
673+ #: ../../c-api/memory.rst:453
673674msgid ""
674675"Check that the :term:`GIL <global interpreter lock>` is held when allocator "
675676"functions of :c:data:`PYMEM_DOMAIN_OBJ` (ex: :c:func:`PyObject_Malloc`) and "
676677":c:data:`PYMEM_DOMAIN_MEM` (ex: :c:func:`PyMem_Malloc`) domains are called"
677678msgstr ""
678679
679- #: ../../c-api/memory.rst:457
680+ #: ../../c-api/memory.rst:458
680681msgid ""
681682"On error, the debug hooks use the :mod:`tracemalloc` module to get the "
682683"traceback where a memory block was allocated. The traceback is only "
683684"displayed if :mod:`tracemalloc` is tracing Python memory allocations and the"
684685" memory block was traced."
685686msgstr ""
686687
687- #: ../../c-api/memory.rst:462
688+ #: ../../c-api/memory.rst:463
688689msgid ""
689690"These hooks are :ref:`installed by default <default-memory-allocators>` if "
690691"Python is compiled in debug mode. The :envvar:`PYTHONMALLOC` environment "
691692"variable can be used to install debug hooks on a Python compiled in release "
692693"mode."
693694msgstr ""
694695
695- #: ../../c-api/memory.rst:467
696+ #: ../../c-api/memory.rst:468
696697msgid ""
697698"This function now also works on Python compiled in release mode. On error, "
698699"the debug hooks now use :mod:`tracemalloc` to get the traceback where a "
@@ -701,11 +702,18 @@ msgid ""
701702":c:data:`PYMEM_DOMAIN_MEM` domains are called."
702703msgstr ""
703704
704- #: ../../c-api/memory.rst:478
705+ #: ../../c-api/memory.rst:475
706+ msgid ""
707+ "Byte patterns ``0xCB`` (``CLEANBYTE``), ``0xDB`` (``DEADBYTE``) and ``0xFB``"
708+ " (``FORBIDDENBYTE``) have been replaced with ``0xCD``, ``0xDD`` and ``0xFD``"
709+ " to use the same values than Windows CRT debug ``malloc()`` and ``free()``."
710+ msgstr ""
711+
712+ #: ../../c-api/memory.rst:485
705713msgid "The pymalloc allocator"
706714msgstr ""
707715
708- #: ../../c-api/memory.rst:480
716+ #: ../../c-api/memory.rst:487
709717msgid ""
710718"Python has a *pymalloc* allocator optimized for small objects (smaller or "
711719"equal to 512 bytes) with a short lifetime. It uses memory mappings called "
@@ -714,83 +722,83 @@ msgid ""
714722"larger than 512 bytes."
715723msgstr ""
716724
717- #: ../../c-api/memory.rst:485
725+ #: ../../c-api/memory.rst:492
718726msgid ""
719727"*pymalloc* is the :ref:`default allocator <default-memory-allocators>` of "
720728"the :c:data:`PYMEM_DOMAIN_MEM` (ex: :c:func:`PyMem_Malloc`) and "
721729":c:data:`PYMEM_DOMAIN_OBJ` (ex: :c:func:`PyObject_Malloc`) domains."
722730msgstr ""
723731
724- #: ../../c-api/memory.rst:489
732+ #: ../../c-api/memory.rst:496
725733msgid "The arena allocator uses the following functions:"
726734msgstr ""
727735
728- #: ../../c-api/memory.rst:491
736+ #: ../../c-api/memory.rst:498
729737msgid ":c:func:`VirtualAlloc` and :c:func:`VirtualFree` on Windows,"
730738msgstr ""
731739
732- #: ../../c-api/memory.rst:492
740+ #: ../../c-api/memory.rst:499
733741msgid ":c:func:`mmap` and :c:func:`munmap` if available,"
734742msgstr ""
735743
736- #: ../../c-api/memory.rst:493
744+ #: ../../c-api/memory.rst:500
737745msgid ":c:func:`malloc` and :c:func:`free` otherwise."
738746msgstr ""
739747
740- #: ../../c-api/memory.rst:496
748+ #: ../../c-api/memory.rst:503
741749msgid "Customize pymalloc Arena Allocator"
742750msgstr ""
743751
744- #: ../../c-api/memory.rst:502
752+ #: ../../c-api/memory.rst:509
745753msgid ""
746754"Structure used to describe an arena allocator. The structure has three "
747755"fields:"
748756msgstr ""
749757
750- #: ../../c-api/memory.rst:510
758+ #: ../../c-api/memory.rst:517
751759msgid "``void* alloc(void *ctx, size_t size)``"
752760msgstr ""
753761
754- #: ../../c-api/memory.rst:510
762+ #: ../../c-api/memory.rst:517
755763msgid "allocate an arena of size bytes"
756764msgstr ""
757765
758- #: ../../c-api/memory.rst:512
766+ #: ../../c-api/memory.rst:519
759767msgid "``void free(void *ctx, size_t size, void *ptr)``"
760768msgstr ""
761769
762- #: ../../c-api/memory.rst:512
770+ #: ../../c-api/memory.rst:519
763771msgid "free an arena"
764772msgstr ""
765773
766- #: ../../c-api/memory.rst:517
774+ #: ../../c-api/memory.rst:524
767775msgid "Get the arena allocator."
768776msgstr ""
769777
770- #: ../../c-api/memory.rst:521
778+ #: ../../c-api/memory.rst:528
771779msgid "Set the arena allocator."
772780msgstr ""
773781
774- #: ../../c-api/memory.rst:525
782+ #: ../../c-api/memory.rst:532
775783msgid "tracemalloc C API"
776784msgstr ""
777785
778- #: ../../c-api/memory.rst:549
786+ #: ../../c-api/memory.rst:556
779787msgid "Examples"
780788msgstr "示例"
781789
782- #: ../../c-api/memory.rst:551
790+ #: ../../c-api/memory.rst:558
783791msgid ""
784792"Here is the example from section :ref:`memoryoverview`, rewritten so that "
785793"the I/O buffer is allocated from the Python heap by using the first function"
786794" set::"
787795msgstr ""
788796
789- #: ../../c-api/memory.rst:564
797+ #: ../../c-api/memory.rst:571
790798msgid "The same code using the type-oriented function set::"
791799msgstr ""
792800
793- #: ../../c-api/memory.rst:576
801+ #: ../../c-api/memory.rst:583
794802msgid ""
795803"Note that in the two examples above, the buffer is always manipulated via "
796804"functions belonging to the same set. Indeed, it is required to use the same "
@@ -800,15 +808,15 @@ msgid ""
800808" different allocators operating on different heaps. ::"
801809msgstr ""
802810
803- #: ../../c-api/memory.rst:591
811+ #: ../../c-api/memory.rst:598
804812msgid ""
805813"In addition to the functions aimed at handling raw memory blocks from the "
806814"Python heap, objects in Python are allocated and released with "
807815":c:func:`PyObject_New`, :c:func:`PyObject_NewVar` and "
808816":c:func:`PyObject_Del`."
809817msgstr ""
810818
811- #: ../../c-api/memory.rst:595
819+ #: ../../c-api/memory.rst:602
812820msgid ""
813821"These will be explained in the next chapter on defining and implementing new"
814822" object types in C."
0 commit comments