msgid ""
msgstr ""
"Project-Id-Version: English (Boost Json Translation (zh_Hans))\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2026-06-06 13:40+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: English <https://insights.cppalliance.org/weblate/projects/"
"boost-json-documentation-zh_Hans/doc-pages-allocators-storage-ptr-adoc/en/>\n"
"Language: en\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 2026.5\n"

#: :11
#, read-only, safe-html, strict-same
msgid ""
"= `storage_ptr` Variable-length containers in this library all use "
"dynamically allocated memory to store their contents. Callers can gain "
"control over the strategy used for allocation by specifying a "
"<<ref_storage_ptr>> in select constructors and function parameter lists. A "
"<<ref_storage_ptr>> has these properties:"
msgstr ""
"= `storage_ptr` Variable-length containers in this library all use "
"dynamically allocated memory to store their contents. Callers can gain "
"control over the strategy used for allocation by specifying a "
"<<ref_storage_ptr>> in select constructors and function parameter lists. A "
"<<ref_storage_ptr>> has these properties:"

#: :17
#, read-only, safe-html, strict-same
msgid "A storage pointer always points to a valid,"
msgstr "A storage pointer always points to a valid,"

#: :18
#, read-only, safe-html, strict-same
msgid "type-erased {ref_memory_resource}."
msgstr "type-erased {ref_memory_resource}."

#: :20
#, read-only, safe-html, strict-same
msgid "Default-constructed storage pointers reference the"
msgstr "Default-constructed storage pointers reference the"

#: :21
#, read-only, safe-html, strict-same
msgid ""
"<<default_memory_resource,default resource>>, an implementation-defined "
"instance which always uses the equivalent of global operator new and delete."
msgstr ""
"<<default_memory_resource,default resource>>, an implementation-defined "
"instance which always uses the equivalent of global operator new and delete."

#: :24
#, read-only, safe-html, strict-same
msgid "Storage pointers constructed from a {ref_memory_resource} or"
msgstr "Storage pointers constructed from a {ref_memory_resource} or"

#: :25
#, read-only, safe-html, strict-same
msgid ""
"{ref_polymorphic_allocator} do not acquire ownership; the caller is "
"responsible for ensuring that the lifetime of the resource extends until it "
"is no longer referenced."
msgstr ""
"{ref_polymorphic_allocator} do not acquire ownership; the caller is "
"responsible for ensuring that the lifetime of the resource extends until it "
"is no longer referenced."

#: :29
#, read-only, safe-html, strict-same
msgid ""
"A storage pointer obtained from <<ref_make_shared_resource>> acquires shared"
msgstr ""
"A storage pointer obtained from <<ref_make_shared_resource>> acquires shared"

#: :30
#, read-only, safe-html, strict-same
msgid ""
"ownership of the memory resource; the lifetime of the resource is extended "
"until all copies of the storage pointer are destroyed."
msgstr ""
"ownership of the memory resource; the lifetime of the resource is extended "
"until all copies of the storage pointer are destroyed."

#: :33
#, read-only, safe-html, strict-same
msgid ""
"The storage pointer remembers the value of <<ref_is_deallocate_trivial>>"
msgstr ""
"The storage pointer remembers the value of <<ref_is_deallocate_trivial>>"

#: :34
#, read-only, safe-html, strict-same
msgid ""
"before type-erasing the resource, allowing the value to be queried at run-"
"time."
msgstr ""
"before type-erasing the resource, allowing the value to be queried at run-"
"time."

#: :37
#, read-only, safe-html, strict-same
msgid ""
"This lists all of the allocation-related types and functions available when "
"using the library:"
msgstr ""
"This lists all of the allocation-related types and functions available when "
"using the library:"

#: :41
#, read-only, safe-html, strict-same
msgid "Name"
msgstr "Name"

#: :41
#, read-only, safe-html, strict-same
msgid "Description"
msgstr "Description"

#: :41
#, read-only, safe-html, strict-same
msgid "<<ref_get_null_resource>>"
msgstr "<<ref_get_null_resource>>"

#: :41
#, read-only, safe-html, strict-same
msgid "Returns a pointer to a memory resource instance which always throws an"
msgstr "Returns a pointer to a memory resource instance which always throws an"

#: :46
#, read-only, safe-html, strict-same
msgid ""
"exception upon allocation. This is used to to achieve the invariant that no "
"parsing or container operation will dynamically allocate memory."
msgstr ""
"exception upon allocation. This is used to to achieve the invariant that no "
"parsing or container operation will dynamically allocate memory."

#: :49
#, read-only, safe-html, strict-same
msgid "<<ref_is_deallocate_trivial>>"
msgstr "<<ref_is_deallocate_trivial>>"

#: :49
#, read-only, safe-html, strict-same
msgid ""
"A customization point allowing a memory resource type to indicate that calls"
msgstr ""
"A customization point allowing a memory resource type to indicate that calls"

#: :51
#, read-only, safe-html, strict-same
msgid "to deallocate are trivial."
msgstr "to deallocate are trivial."

#: :53
#, read-only, safe-html, strict-same
msgid "<<ref_make_shared_resource>>"
msgstr "<<ref_make_shared_resource>>"

#: :53
#, read-only, safe-html, strict-same
msgid "A function returning a smart pointer with shared ownership of a newly"
msgstr "A function returning a smart pointer with shared ownership of a newly"

#: :55
#, read-only, safe-html, strict-same
msgid "allocated memory resource."
msgstr "allocated memory resource."

#: :57
#, read-only, safe-html, strict-same
msgid "{ref_memory_resource}"
msgstr "{ref_memory_resource}"

#: :57
#, read-only, safe-html, strict-same
msgid "The abstract base class representing an allocator."
msgstr "The abstract base class representing an allocator."

#: :57
#, read-only, safe-html, strict-same
msgid "<<ref_monotonic_resource>>"
msgstr "<<ref_monotonic_resource>>"

#: :57
#, read-only, safe-html, strict-same
msgid ""
"A memory resource which allocates large blocks of memory and has a trivial"
msgstr ""
"A memory resource which allocates large blocks of memory and has a trivial"

#: :62
#, read-only, safe-html, strict-same
msgid ""
"deallocate function. Allocated memory is not freed until the resource is "
"destroyed, making it fast for parsing but not suited for performing "
"modifications."
msgstr ""
"deallocate function. Allocated memory is not freed until the resource is "
"destroyed, making it fast for parsing but not suited for performing "
"modifications."

#: :66
#, read-only, safe-html, strict-same
msgid "{ref_polymorphic_allocator}"
msgstr "{ref_polymorphic_allocator}"

#: :66
#, read-only, safe-html, strict-same
msgid "An {req_Allocator} which uses a reference to a {ref_memory_resource} to"
msgstr "An {req_Allocator} which uses a reference to a {ref_memory_resource} to"

#: :68
#, read-only, safe-html, strict-same
msgid "perform allocations."
msgstr "perform allocations."

#: :70
#, read-only, safe-html, strict-same
msgid "<<ref_static_resource>>"
msgstr "<<ref_static_resource>>"

#: :70
#, read-only, safe-html, strict-same
msgid "A memory resource that uses a single caller provided buffer. No dynamic"
msgstr "A memory resource that uses a single caller provided buffer. No dynamic"

#: :72
#, read-only, safe-html, strict-same
msgid ""
"allocations are used. This is fast for parsing but not suited for performing "
"modifications."
msgstr ""
"allocations are used. This is fast for parsing but not suited for performing "
"modifications."

#: :75
#, read-only, safe-html, strict-same
msgid "<<ref_storage_ptr>>"
msgstr "<<ref_storage_ptr>>"

#: :75
#, read-only, safe-html, strict-same
msgid "A smart pointer through which a {ref_memory_resource} is managed and"
msgstr "A smart pointer through which a {ref_memory_resource} is managed and"

#: :77
#, read-only, safe-html, strict-same
msgid "accessed. |==="
msgstr "accessed. |==="

#: :80
#, read-only, safe-html, strict-same
msgid "Default Memory Resource"
msgstr "Default Memory Resource"

#: :81
#, read-only, safe-html, strict-same
msgid ""
"The default memory resource uses the global `operator new` and `operator "
"delete` to allocate memory. This resource is not reference counted and has a "
"non-trivial deallocate function. All default-constructed <<ref_storage_ptr>> "
"objects reference the same memory resource:"
msgstr ""
"The default memory resource uses the global `operator new` and `operator "
"delete` to allocate memory. This resource is not reference counted and has a "
"non-trivial deallocate function. All default-constructed <<ref_storage_ptr>> "
"objects reference the same memory resource:"

#: :91
#, read-only, safe-html, strict-same
msgid "Default-constructed library containers use the default memory resource:"
msgstr "Default-constructed library containers use the default memory resource:"

#: :98
#, read-only, safe-html, strict-same
msgid ""
"The default memory resource is well suited for general usage. It offers "
"reasonable performance for parsing, and conservative memory usage for "
"modification of the contents of containers."
msgstr ""
"The default memory resource is well suited for general usage. It offers "
"reasonable performance for parsing, and conservative memory usage for "
"modification of the contents of containers."

#: :103
#, read-only, safe-html, strict-same
msgid ""
"This memory resource is not guaranteed to be the same as the result of "
"`boost::container::pmr::get_default_resource`. It also cannot be changed "
"with `boost::container::pmr::set_default_resource`."
msgstr ""
"This memory resource is not guaranteed to be the same as the result of "
"`boost::container::pmr::get_default_resource`. It also cannot be changed "
"with `boost::container::pmr::set_default_resource`."

#: :107
#, read-only, safe-html, strict-same
msgid "Monotonic Resource"
msgstr "Monotonic Resource"

#: :108
#, read-only, safe-html, strict-same
msgid ""
"Consider the pattern of memory allocation during parsing: when an array, "
"object, or string is encountered the parser accumulates elements in its "
"temporary storage area. When all of the elements are known, a single memory "
"allocation is requested from the resource when constructing the value. Thus, "
"parsing only allocates and constructs containers at their final size. Memory "
"is not reallocated; that is, a memory buffer never needs to grow by "
"allocating a new larger buffer and deallocating the previous buffer."
msgstr ""
"Consider the pattern of memory allocation during parsing: when an array, "
"object, or string is encountered the parser accumulates elements in its "
"temporary storage area. When all of the elements are known, a single memory "
"allocation is requested from the resource when constructing the value. Thus, "
"parsing only allocates and constructs containers at their final size. Memory "
"is not reallocated; that is, a memory buffer never needs to grow by "
"allocating a new larger buffer and deallocating the previous buffer."

#: :116
#, read-only, safe-html, strict-same
msgid ""
"The <<ref_monotonic_resource>> optimizes this memory allocation pattern by "
"allocating increasingly large blocks of global memory internally and "
"parceling those blocks out in smaller pieces to fulfill allocation requests. "
"It has a trivial deallocate function. The monotonic resource does not "
"actually deallocate memory until the resource is destroyed. Thus, it is "
"ideally suited for the use-case where JSON is parsed, and the resulting "
"value is then inspected but not modified."
msgstr ""
"The <<ref_monotonic_resource>> optimizes this memory allocation pattern by "
"allocating increasingly large blocks of global memory internally and "
"parceling those blocks out in smaller pieces to fulfill allocation requests. "
"It has a trivial deallocate function. The monotonic resource does not "
"actually deallocate memory until the resource is destroyed. Thus, it is "
"ideally suited for the use-case where JSON is parsed, and the resulting "
"value is then inspected but not modified."

#: :124
#, read-only, safe-html, strict-same
msgid ""
"The resource to use when constructing values may be specified in calls to "
"<<ref_parse>> as shown here:"
msgstr ""
"The resource to use when constructing values may be specified in calls to "
"<<ref_parse>> as shown here:"

#: :132
#, read-only, safe-html, strict-same
msgid "Or, to parse into a value with shared ownership of the memory resource:"
msgstr "Or, to parse into a value with shared ownership of the memory resource:"

#: :139
#, read-only, safe-html, strict-same
msgid ""
"A monotonic resource may be optionally constructed with an initial buffer to "
"use first, before going to the heap. This allows the caller to use stack "
"space and avoid dynamic allocations for most parsed JSON, falling back to "
"dynamic allocation from the heap if the input JSON is larger than average, "
"as shown here:"
msgstr ""
"A monotonic resource may be optionally constructed with an initial buffer to "
"use first, before going to the heap. This allows the caller to use stack "
"space and avoid dynamic allocations for most parsed JSON, falling back to "
"dynamic allocation from the heap if the input JSON is larger than average, "
"as shown here:"

#: :150
#, read-only, safe-html, strict-same
msgid "Static Resource"
msgstr "Static Resource"

#: :151
#, read-only, safe-html, strict-same
msgid ""
"A <<ref_static_resource>> constructs from a caller-provided buffer, and "
"satisfies all memory allocation requests from the buffer. Once the buffer is "
"exhausted, subsequent calls to allocate throw the exception "
"`std::bad_alloc`. The resource offers a simple invariant: dynamic heap "
"allocations are never performed."
msgstr ""
"A <<ref_static_resource>> constructs from a caller-provided buffer, and "
"satisfies all memory allocation requests from the buffer. Once the buffer is "
"exhausted, subsequent calls to allocate throw the exception "
"`std::bad_alloc`. The resource offers a simple invariant: dynamic heap "
"allocations are never performed."

#: :157
#, read-only, safe-html, strict-same
msgid "To use the resource, construct it with a local buffer:"
msgstr "To use the resource, construct it with a local buffer:"

#: :164
#, read-only, safe-html, strict-same
msgid "Null Resource"
msgstr "Null Resource"

#: :165
#, read-only, safe-html, strict-same
msgid ""
"The function <<ref_get_null_resource>> returns a global instance of the null "
"resource. This resource offers a simple invariant: all calls to allocate "
"will throw the exception `std::bad_alloc`. An instance of the null resource "
"can be used to make parsing guarantee that allocations from the heap are "
"never made. This is explored in more detail in a later section."
msgstr ""
"The function <<ref_get_null_resource>> returns a global instance of the null "
"resource. This resource offers a simple invariant: all calls to allocate "
"will throw the exception `std::bad_alloc`. An instance of the null resource "
"can be used to make parsing guarantee that allocations from the heap are "
"never made. This is explored in more detail in a later section."

#: :171
#, read-only, safe-html, strict-same
msgid "Allocator Propagation"
msgstr "Allocator Propagation"

#: :172
#, read-only, safe-html, strict-same
msgid ""
"The containers <<ref_array>>, <<ref_object>>, and <<ref_value>> all "
"propagate the memory resource they were constructed with to child elements:"
msgstr ""
"The containers <<ref_array>>, <<ref_object>>, and <<ref_value>> all "
"propagate the memory resource they were constructed with to child elements:"

#: :180
#, read-only, safe-html, strict-same
msgid ""
"This propagation acts recursively, containers within containers will all "
"have the resource propagated. Once a container is constructed, its memory "
"resource can never be changed."
msgstr ""
"This propagation acts recursively, containers within containers will all "
"have the resource propagated. Once a container is constructed, its memory "
"resource can never be changed."

#: :184
#, read-only, safe-html, strict-same
msgid "Resource Lifetime"
msgstr "Resource Lifetime"

#: :185
#, read-only, safe-html, strict-same
msgid ""
"It is important to note that <<ref_storage_ptr>> supports both shared-"
"ownership and reference lifetime models. Construction from a memory resource "
"pointer does not transfer ownership:"
msgstr ""
"It is important to note that <<ref_storage_ptr>> supports both shared-"
"ownership and reference lifetime models. Construction from a memory resource "
"pointer does not transfer ownership:"

#: :194
#, read-only, safe-html, strict-same
msgid ""
"When using a memory resource in this fashion, including the case where a "
"storage pointer or container is constructed from a "
"{ref_polymorphic_allocator}, the caller must ensure that the lifetime of the "
"resource is extended until it is no longer referenced by any variables; "
"otherwise, undefined behavior is possible."
msgstr ""
"When using a memory resource in this fashion, including the case where a "
"storage pointer or container is constructed from a "
"{ref_polymorphic_allocator}, the caller must ensure that the lifetime of the "
"resource is extended until it is no longer referenced by any variables; "
"otherwise, undefined behavior is possible."

#: :200
#, read-only, safe-html, strict-same
msgid ""
"Shared ownership is achieved using the function <<ref_make_shared_resource>>"
", which creates a new, reference-counted memory resource using a dynamic "
"memory allocation and returns it as a <<ref_storage_ptr>>:"
msgstr ""
"Shared ownership is achieved using the function <<ref_make_shared_resource>>"
", which creates a new, reference-counted memory resource using a dynamic "
"memory allocation and returns it as a <<ref_storage_ptr>>:"

#: :209
#, read-only, safe-html, strict-same
msgid ""
"When a storage pointer is constructed this way, the lifetime of the "
"referenced memory resource is extended until all variables which reference "
"it are destroyed."
msgstr ""
"When a storage pointer is constructed this way, the lifetime of the "
"referenced memory resource is extended until all variables which reference "
"it are destroyed."

#: :213
#, read-only, safe-html, strict-same
msgid "User-Defined Resource"
msgstr "User-Defined Resource"

#: :214
#, read-only, safe-html, strict-same
msgid ""
"To implement custom memory allocation strategies, derive your class from "
"{ref_memory_resource} and implement the functions `do_allocate`, "
"`do_deallocate`, and `do_is_equal` as seen in this example below, which logs "
"each operation it performs to the console:"
msgstr ""
"To implement custom memory allocation strategies, derive your class from "
"{ref_memory_resource} and implement the functions `do_allocate`, "
"`do_deallocate`, and `do_is_equal` as seen in this example below, which logs "
"each operation it performs to the console:"
