Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
third_party
dart-lang
sdk
runtime
bin
io_buffer.h
Go to the documentation of this file.
1
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2
// for details. All rights reserved. Use of this source code is governed by a
3
// BSD-style license that can be found in the LICENSE file.
4
5
#ifndef RUNTIME_BIN_IO_BUFFER_H_
6
#define RUNTIME_BIN_IO_BUFFER_H_
7
8
#include "
include/dart_api.h
"
9
#include "
platform/globals.h
"
10
11
namespace
dart
{
12
namespace
bin {
13
14
class
IOBuffer
{
15
public
:
16
// Allocate an IO buffer dart object (of type Uint8List) backed by
17
// an external byte array.
18
static
Dart_Handle
Allocate
(intptr_t size, uint8_t**
buffer
);
19
20
// Allocate IO buffer storage.
21
static
uint8_t*
Allocate
(intptr_t size);
22
23
// Reallocate IO buffer storage.
24
static
uint8_t*
Reallocate
(uint8_t*
buffer
, intptr_t new_size);
25
26
// Function for disposing of IO buffer storage. All backing storage
27
// for IO buffers must be freed using this function.
28
static
void
Free
(
void
*
buffer
) { free(
buffer
); }
29
30
// Function for finalizing external byte arrays used as IO buffers.
31
static
void
Finalizer
(
void
* isolate_callback_data,
void
*
buffer
) {
32
Free
(
buffer
);
33
}
34
35
private
:
36
DISALLOW_ALLOCATION();
37
DISALLOW_IMPLICIT_CONSTRUCTORS
(
IOBuffer
);
38
};
39
40
}
// namespace bin
41
}
// namespace dart
42
43
#endif
// RUNTIME_BIN_IO_BUFFER_H_
dart::bin::IOBuffer
Definition
io_buffer.h:14
dart::bin::IOBuffer::Free
static void Free(void *buffer)
Definition
io_buffer.h:28
dart::bin::IOBuffer::Finalizer
static void Finalizer(void *isolate_callback_data, void *buffer)
Definition
io_buffer.h:31
dart::bin::IOBuffer::Allocate
static Dart_Handle Allocate(intptr_t size, uint8_t **buffer)
Definition
io_buffer.cc:12
dart::bin::IOBuffer::Reallocate
static uint8_t * Reallocate(uint8_t *buffer, intptr_t new_size)
Definition
io_buffer.cc:34
dart_api.h
Dart_Handle
struct _Dart_Handle * Dart_Handle
Definition
dart_api.h:258
buffer
static const uint8_t buffer[]
Definition
fl_pixel_buffer_texture_test.cc:44
dart
Definition
dart_vm.cc:33
globals.h
DISALLOW_IMPLICIT_CONSTRUCTORS
#define DISALLOW_IMPLICIT_CONSTRUCTORS(TypeName)
Definition
globals.h:593
Generated on Fri Apr 26 2024 06:14:42 for Flutter Engine by
1.9.8