<?xml version="1.0" encoding="utf-8"?>
<resources>
    <string name="">= `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 &lt;&lt;ref_storage_ptr&gt;&gt; in select constructors and function parameter lists. A &lt;&lt;ref_storage_ptr&gt;&gt; has these properties:</string>
    <string name="">A storage pointer always points to a valid,</string>
    <string name="">type-erased {ref_memory_resource}.</string>
    <string name="">Default-constructed storage pointers reference the</string>
    <string name="">&lt;&lt;default_memory_resource,default resource&gt;&gt;, an implementation-defined instance which always uses the equivalent of global operator new and delete.</string>
    <string name="">Storage pointers constructed from a {ref_memory_resource} or</string>
    <string name="">{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.</string>
    <string name="">A storage pointer obtained from &lt;&lt;ref_make_shared_resource&gt;&gt; acquires shared</string>
    <string name="">ownership of the memory resource; the lifetime of the resource is extended until all copies of the storage pointer are destroyed.</string>
    <string name="">The storage pointer remembers the value of &lt;&lt;ref_is_deallocate_trivial&gt;&gt;</string>
    <string name="">before type-erasing the resource, allowing the value to be queried at run-time.</string>
    <string name="">This lists all of the allocation-related types and functions available when using the library:</string>
    <string name="">Name</string>
    <string name="">Description</string>
    <string name="">&lt;&lt;ref_get_null_resource&gt;&gt;</string>
    <string name="">Returns a pointer to a memory resource instance which always throws an</string>
    <string name="">exception upon allocation. This is used to to achieve the invariant that no parsing or container operation will dynamically allocate memory.</string>
    <string name="">&lt;&lt;ref_is_deallocate_trivial&gt;&gt;</string>
    <string name="">A customization point allowing a memory resource type to indicate that calls</string>
    <string name="">to deallocate are trivial.</string>
    <string name="">&lt;&lt;ref_make_shared_resource&gt;&gt;</string>
    <string name="">A function returning a smart pointer with shared ownership of a newly</string>
    <string name="">allocated memory resource.</string>
    <string name="">{ref_memory_resource}</string>
    <string name="">The abstract base class representing an allocator.</string>
    <string name="">&lt;&lt;ref_monotonic_resource&gt;&gt;</string>
    <string name="">A memory resource which allocates large blocks of memory and has a trivial</string>
    <string name="">deallocate function. Allocated memory is not freed until the resource is destroyed, making it fast for parsing but not suited for performing modifications.</string>
    <string name="">{ref_polymorphic_allocator}</string>
    <string name="">An {req_Allocator} which uses a reference to a {ref_memory_resource} to</string>
    <string name="">perform allocations.</string>
    <string name="">&lt;&lt;ref_static_resource&gt;&gt;</string>
    <string name="">A memory resource that uses a single caller provided buffer. No dynamic</string>
    <string name="">allocations are used. This is fast for parsing but not suited for performing modifications.</string>
    <string name="">&lt;&lt;ref_storage_ptr&gt;&gt;</string>
    <string name="">A smart pointer through which a {ref_memory_resource} is managed and</string>
    <string name="">accessed. |===</string>
    <string name="">Default Memory Resource</string>
    <string name="">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 &lt;&lt;ref_storage_ptr&gt;&gt; objects reference the same memory resource:</string>
    <string name="">Default-constructed library containers use the default memory resource:</string>
    <string name="">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.</string>
    <string name="">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`.</string>
    <string name="">Monotonic Resource</string>
    <string name="">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.</string>
    <string name="">The &lt;&lt;ref_monotonic_resource&gt;&gt; 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.</string>
    <string name="">The resource to use when constructing values may be specified in calls to &lt;&lt;ref_parse&gt;&gt; as shown here:</string>
    <string name="">Or, to parse into a value with shared ownership of the memory resource:</string>
    <string name="">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:</string>
    <string name="">Static Resource</string>
    <string name="">A &lt;&lt;ref_static_resource&gt;&gt; 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.</string>
    <string name="">To use the resource, construct it with a local buffer:</string>
    <string name="">Null Resource</string>
    <string name="">The function &lt;&lt;ref_get_null_resource&gt;&gt; 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.</string>
    <string name="">Allocator Propagation</string>
    <string name="">The containers &lt;&lt;ref_array&gt;&gt;, &lt;&lt;ref_object&gt;&gt;, and &lt;&lt;ref_value&gt;&gt; all propagate the memory resource they were constructed with to child elements:</string>
    <string name="">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.</string>
    <string name="">Resource Lifetime</string>
    <string name="">It is important to note that &lt;&lt;ref_storage_ptr&gt;&gt; supports both shared-ownership and reference lifetime models. Construction from a memory resource pointer does not transfer ownership:</string>
    <string name="">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.</string>
    <string name="">Shared ownership is achieved using the function &lt;&lt;ref_make_shared_resource&gt;&gt;, which creates a new, reference-counted memory resource using a dynamic memory allocation and returns it as a &lt;&lt;ref_storage_ptr&gt;&gt;:</string>
    <string name="">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.</string>
    <string name="">User-Defined Resource</string>
    <string name="">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:</string>
</resources>
