Add missing import for malloc (flutter/engine#56781)

Internal bug: b/380745221

The use of `malloc` in L70:

d48ceb1ba2/third_party/tonic/filesystem/filesystem/file.cc (L70)

Results in the following error, after an update to the internal toolchain. For some reason, this error only appears when targeting Linux.

```
tonic/filesystem/filesystem/file.cc:70:28: error: use of undeclared identifier 'malloc'
   70 |   uint8_t* ptr = (uint8_t*)malloc(file_size);
      |                            ^
1 error generated.
```

This PR fixes it by including the header file.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
This commit is contained in:
Jia Hao
2024-11-26 00:47:19 +08:00
committed by GitHub
parent 5a3cfd2ba4
commit a442db2c24

View File

@@ -5,6 +5,7 @@
#include "tonic/filesystem/filesystem/file.h"
#include <fcntl.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <climits>