Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Classes | Functions
SkContainers.h File Reference
#include "include/private/base/SkAPI.h"
#include "include/private/base/SkAlign.h"
#include "include/private/base/SkSpan_impl.h"
#include <cstddef>
#include <cstdint>

Go to the source code of this file.

Classes

class  SkContainerAllocator
 

Functions

SkSpan< std::byte > sk_allocate_canfail (size_t size)
 
SkSpan< std::byte > sk_allocate_throw (size_t size)
 
SK_SPI void sk_report_container_overflow_and_die ()
 

Function Documentation

◆ sk_allocate_canfail()

SkSpan< std::byte > sk_allocate_canfail ( size_t  size)

Definition at line 62 of file SkContainers.cpp.

62 {
63 // Make sure to ask for at least the minimum number of bytes.
64 const size_t adjustedSize = std::max(size, kMinBytes);
65 void* ptr = sk_malloc_canfail(adjustedSize);
66 return complete_size(ptr, adjustedSize);
67}
static void * sk_malloc_canfail(size_t size)
Definition SkMalloc.h:93

◆ sk_allocate_throw()

SkSpan< std::byte > sk_allocate_throw ( size_t  size)

Definition at line 69 of file SkContainers.cpp.

69 {
70 if (size == 0) {
71 return {};
72 }
73 // Make sure to ask for at least the minimum number of bytes.
74 const size_t adjustedSize = std::max(size, kMinBytes);
75 void* ptr = sk_malloc_throw(adjustedSize);
76 return complete_size(ptr, adjustedSize);
77}
static void * sk_malloc_throw(size_t size)
Definition SkMalloc.h:67

◆ sk_report_container_overflow_and_die()

SK_SPI void sk_report_container_overflow_and_die ( )

Definition at line 79 of file SkContainers.cpp.

79 {
80 SK_ABORT("Requested capacity is too large.");
81}
#define SK_ABORT(message,...)
Definition SkAssert.h:70