Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
third_party
dart-lang
sdk
runtime
platform
allocation.cc
Go to the documentation of this file.
1
// Copyright (c) 2020, 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
#include "
platform/allocation.h
"
6
7
#include "
platform/assert.h
"
8
9
namespace
dart
{
10
11
void
*
calloc
(
size_t
n,
size_t
size) {
12
void
*
result
=
::calloc
(n, size);
13
if
(
result
==
nullptr
) {
14
OUT_OF_MEMORY
();
15
}
16
return
result
;
17
}
18
19
void
*
malloc
(
size_t
size) {
20
void
*
result
=
::malloc
(size);
21
if
(
result
==
nullptr
) {
22
OUT_OF_MEMORY
();
23
}
24
return
result
;
25
}
26
27
void
*
realloc
(
void
* ptr,
size_t
size) {
28
void
*
result
=
::realloc
(ptr, size);
29
if
(
result
==
nullptr
) {
30
OUT_OF_MEMORY
();
31
}
32
return
result
;
33
}
34
35
}
// namespace dart
assert.h
OUT_OF_MEMORY
#define OUT_OF_MEMORY()
Definition:
assert.h:250
result
GAsyncResult * result
Definition:
fl_text_input_plugin.cc:106
dart
Definition:
dart_vm.cc:33
dart::malloc
void * malloc(size_t size)
Definition:
allocation.cc:19
dart::calloc
void * calloc(size_t n, size_t size)
Definition:
allocation.cc:11
dart::realloc
void * realloc(void *ptr, size_t size)
Definition:
allocation.cc:27
allocation.h
Generated on Wed Sep 27 2023 04:48:44 for Flutter Engine by
1.9.6