Function AllocateSelf

Summary

#include <include/EASTL/string.h>

(1) void AllocateSelf()

(2) void AllocateSelf(size_type n)

Function overload

Synopsis

#include <include/EASTL/string.h>

void AllocateSelf()

Description

No description yet.

Source

Lines 3310-3314 in include/EASTL/string.h. Line 758 in include/EASTL/string.h.

template <typename T, typename Allocator>
inline void basic_string<T, Allocator>::AllocateSelf()
{
    internalLayout().ResetToSSO();
}

Synopsis

#include <include/EASTL/string.h>

void AllocateSelf(size_type n)

Description

No description yet.

Source

Lines 3317-3339 in include/EASTL/string.h. Line 759 in include/EASTL/string.h.

template <typename T, typename Allocator>
void basic_string<T, Allocator>::AllocateSelf(size_type n)
{
    #if EASTL_ASSERT_ENABLED
        if(EASTL_UNLIKELY(n >= 0x40000000))
            EASTL_FAIL_MSG("basic_string::AllocateSelf -- improbably large request.");
    #endif
    #if EASTL_STRING_OPT_LENGTH_ERRORS
        if(EASTL_UNLIKELY(n > max_size()))
            ThrowLengthException();
    #endif
    if(n > SSOLayout::SSO_CAPACITY)
    {
        pointer pBegin = DoAllocate(n + 1);
        internalLayout().SetHeapBeginPtr(pBegin);
        internalLayout().SetHeapCapacity(n);
        internalLayout().SetHeapSize(n);
    }
    else
        internalLayout().SetSSOSize(n);
}





Add Discussion as Guest

Log in