mirror of
https://github.com/denoland/rusty_v8.git
synced 2024-11-24 15:19:31 -05:00
chore: small clean ups (#1073)
This commit is contained in:
parent
5cc0a8556a
commit
0d1ada4387
3 changed files with 10 additions and 9 deletions
6
.gn
6
.gn
|
@ -39,6 +39,12 @@ default_args = {
|
||||||
v8_use_external_startup_data = false
|
v8_use_external_startup_data = false
|
||||||
v8_use_snapshot = true
|
v8_use_snapshot = true
|
||||||
|
|
||||||
|
# Ensure allocation of typed arrays and arraybuffers always goes through
|
||||||
|
# the embedder's ArrayBufferAllocator, otherwise small buffers get moved
|
||||||
|
# around by the garbage collector but embedders normally want them to have
|
||||||
|
# fixed addresses.
|
||||||
|
v8_typed_array_max_size_in_heap = 0
|
||||||
|
|
||||||
# To avoid test failure:
|
# To avoid test failure:
|
||||||
# Fatal error in ../../../v8/src/heap/read-only-spaces.cc, line 69
|
# Fatal error in ../../../v8/src/heap/read-only-spaces.cc, line 69
|
||||||
# Check failed: read_only_blob_checksum_ == snapshot_checksum (<unprintable>
|
# Check failed: read_only_blob_checksum_ == snapshot_checksum (<unprintable>
|
||||||
|
|
6
build.rs
6
build.rs
|
@ -204,12 +204,6 @@ fn build_v8() {
|
||||||
gn_args.push(r#"target_cpu="x86""#.to_string());
|
gn_args.push(r#"target_cpu="x86""#.to_string());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ensure allocation of typed arrays and arraybuffers always goes through
|
|
||||||
// the embedder's ArrayBufferAllocator, otherwise small buffers get moved
|
|
||||||
// around by the garbage collector but embedders normally want them to have
|
|
||||||
// fixed addresses.
|
|
||||||
gn_args.push(r#"v8_typed_array_max_size_in_heap=0"#.into());
|
|
||||||
|
|
||||||
let gn_root = env::var("CARGO_MANIFEST_DIR").unwrap();
|
let gn_root = env::var("CARGO_MANIFEST_DIR").unwrap();
|
||||||
|
|
||||||
let gn_out = maybe_gen(&gn_root, gn_args);
|
let gn_out = maybe_gen(&gn_root, gn_args);
|
||||||
|
|
|
@ -22,9 +22,9 @@
|
||||||
|
|
||||||
using namespace support;
|
using namespace support;
|
||||||
|
|
||||||
template<typename T>
|
template <typename T>
|
||||||
constexpr size_t align_to(size_t size) {
|
constexpr size_t align_to(size_t size) {
|
||||||
return (size + sizeof(T) - 1) & ~(sizeof(T) - 1);
|
return (size + sizeof(T) - 1) & ~(sizeof(T) - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
static_assert(sizeof(two_pointers_t) ==
|
static_assert(sizeof(two_pointers_t) ==
|
||||||
|
@ -45,7 +45,8 @@ static_assert(sizeof(v8::PromiseRejectMessage) == sizeof(size_t) * 3,
|
||||||
|
|
||||||
static_assert(sizeof(v8::Locker) == sizeof(size_t) * 2, "Locker size mismatch");
|
static_assert(sizeof(v8::Locker) == sizeof(size_t) * 2, "Locker size mismatch");
|
||||||
|
|
||||||
static_assert(sizeof(v8::ScriptCompiler::Source) == align_to<size_t>(sizeof(size_t) * 6 + sizeof(int) * 3),
|
static_assert(sizeof(v8::ScriptCompiler::Source) ==
|
||||||
|
align_to<size_t>(sizeof(size_t) * 6 + sizeof(int) * 3),
|
||||||
"Source size mismatch");
|
"Source size mismatch");
|
||||||
|
|
||||||
static_assert(sizeof(v8::FunctionCallbackInfo<v8::Value>) == sizeof(size_t) * 3,
|
static_assert(sizeof(v8::FunctionCallbackInfo<v8::Value>) == sizeof(size_t) * 3,
|
||||||
|
|
Loading…
Reference in a new issue