Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
basic_types.cc
Go to the documentation of this file.
1// Copyright 2013 The Flutter Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#include "basic_types.h"
6
7#include <cstdint>
8#include <cstdlib>
9
10#include "flutter/fml/logging.h"
11
14 malloc(sizeof(zircon_dart_byte_array_t)));
15 arr->length = size;
16 arr->data = static_cast<uint8_t*>(malloc(size * sizeof(uint8_t)));
17 return arr;
18}
19
21 uint32_t index,
22 uint8_t value) {
23 FML_CHECK(arr);
24 FML_CHECK(arr->length > index);
25 arr->data[index] = value;
26}
27
29 FML_CHECK(arr);
30 free(arr->data);
31 free(arr);
32}
zircon_dart_byte_array_t * zircon_dart_byte_array_create(uint32_t size)
void zircon_dart_byte_array_set_value(zircon_dart_byte_array_t *arr, uint32_t index, uint8_t value)
void zircon_dart_byte_array_free(zircon_dart_byte_array_t *arr)
uint8_t value
#define FML_CHECK(condition)
Definition logging.h:85