mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
Use v8::ArrayBuffer::Allocator inside Node
This commit is contained in:
@@ -27,7 +27,6 @@
|
||||
#include "third_party/icu/source/i18n/unicode/uregex.h"
|
||||
#include "third_party/icu/source/i18n/unicode/uspoof.h"
|
||||
#include "third_party/icu/source/i18n/unicode/usearch.h"
|
||||
#include "util-inl.h"
|
||||
#include "v8-profiler.h"
|
||||
#include "v8-inspector.h"
|
||||
|
||||
@@ -41,18 +40,6 @@ int close(int fd) {
|
||||
return _close(fd);
|
||||
}
|
||||
|
||||
void* ArrayBufferCalloc(size_t length) {
|
||||
return UncheckedCalloc(length);
|
||||
}
|
||||
|
||||
void* ArrayBufferMalloc(size_t length) {
|
||||
return UncheckedMalloc(length);
|
||||
}
|
||||
|
||||
void ArrayBufferFree(void* data, size_t length) {
|
||||
return ::free(data);
|
||||
}
|
||||
|
||||
void ReferenceSymbols() {
|
||||
// Following symbols are used by electron.exe but got stripped by compiler,
|
||||
// by using the symbols we can force compiler to keep the objects in node.dll,
|
||||
|
||||
@@ -21,12 +21,6 @@ namespace node {
|
||||
__declspec(dllexport) int open_osfhandle(intptr_t osfhandle, int flags);
|
||||
__declspec(dllexport) int close(int fd);
|
||||
|
||||
// Memory allocation functions from Node's module, used by ArrayBuffer allocator
|
||||
// to make sure memories are allocated and freed with the same allocator.
|
||||
__declspec(dllexport) void* ArrayBufferCalloc(size_t length);
|
||||
__declspec(dllexport) void* ArrayBufferMalloc(size_t length);
|
||||
__declspec(dllexport) void ArrayBufferFree(void* data, size_t length);
|
||||
|
||||
// A trick to force referencing symbols.
|
||||
__declspec(dllexport) void ReferenceSymbols();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user