A Mapping like NonOwnedMapping, but uses Free as its release proc. More...
#include <mapping.h>
Public Member Functions | |
| MallocMapping () | |
| MallocMapping (uint8_t *data, size_t size) | |
| MallocMapping (fml::MallocMapping &&mapping) | |
| ~MallocMapping () override | |
| size_t | GetSize () const override |
| const uint8_t * | GetMapping () const override |
| bool | IsDontNeedSafe () const override |
| uint8_t * | Release () |
Public Member Functions inherited from fml::Mapping | |
| Mapping () | |
| virtual | ~Mapping () |
Static Public Member Functions | |
| template<typename T > | |
| static MallocMapping | Copy (const T *begin, const T *end) |
| static MallocMapping | Copy (const void *begin, size_t length) |
A Mapping like NonOwnedMapping, but uses Free as its release proc.
| fml::MallocMapping::MallocMapping | ( | ) |
| fml::MallocMapping::MallocMapping | ( | uint8_t * | data, |
| size_t | size | ||
| ) |
Creates a MallocMapping for a region of memory (without copying it). The function will abort() if the malloc fails.
| data | The starting address of the mapping. |
| size | The size of the mapping in bytes. |
Definition at line 121 of file mapping.cc.
| fml::MallocMapping::MallocMapping | ( | fml::MallocMapping && | mapping | ) |
Definition at line 124 of file mapping.cc.
|
override |
Definition at line 130 of file mapping.cc.
|
inlinestatic |
Copies the data from begin to end. It's templated since void* arithemetic isn't allowed and we want support for uint8_t and char.
Definition at line 162 of file mapping.h.
References Copy(), end, FML_DCHECK, and length.
Referenced by Copy(), flutter::CopyNSDataToMapping(), flutter_runner::TextDelegate::DidUpdateState(), DispatchJSONPlatformMessage(), flutter::PlatformViewAndroid::DispatchPlatformMessage(), flutter::PlatformViewAndroid::DispatchSemanticsAction(), FlutterEngineSendPlatformMessage(), FlutterEngineSendSemanticsAction(), if(), flutter::InvokePlatformMessageResponseCallback(), impeller::interop::MakeCopyableMapping(), flutter_runner::MakeLocalizationPlatformMessageData(), flutter_runner::TextDelegate::OnAction(), flutter_runner::PlatformView::OnChildViewStatus(), flutter_runner::TextDelegate::OnKeyEvent(), flutter::RunTester(), fml::TEST(), fml::TEST(), flutter::testing::TEST_F(), flutter_runner::testing::TEST_F(), flutter_runner::testing::TEST_F(), flutter_runner::testing::TEST_F(), flutter_runner::testing::TEST_F(), flutter_runner::testing::TEST_F(), and flutter_runner::testing::FakePlatformMessageResponse::WithMessage().
|
static |
Copies a region of memory into a MallocMapping. The function will abort() if the malloc fails.
| begin | The starting address of where we will copy. |
| length | The length of the region to copy in bytes. |
Definition at line 135 of file mapping.cc.
References FML_CHECK, length, and MallocMapping().
|
overridevirtual |
Implements fml::Mapping.
Definition at line 147 of file mapping.cc.
Referenced by fml::TEST(), fml::TEST(), fml::TEST(), fml::TEST(), fml::TEST(), and fml::TEST().
|
overridevirtual |
Implements fml::Mapping.
Definition at line 143 of file mapping.cc.
Referenced by fml::TEST(), fml::TEST(), fml::TEST(), fml::TEST(), fml::TEST(), and fml::TEST().
|
overridevirtual |
Implements fml::Mapping.
Definition at line 151 of file mapping.cc.
Referenced by fml::TEST().
| uint8_t * fml::MallocMapping::Release | ( | ) |
Removes ownership of the data buffer. After this is called; the mapping will point to nullptr.
Definition at line 155 of file mapping.cc.
Referenced by flutter::PlatformViewAndroidJNIImpl::FlutterViewHandlePlatformMessage(), and fml::TEST().