Skip to content

Commit c8be718

Browse files
psmarshalljasnell
authored andcommitted
v8: backport pieces from 18a26cfe174 from upstream v8
Backport new virtual methods from 18a26cfe174 ("Add memory protection API to ArrayBuffer::Allocator") PR-URL: #13217 Reviewed-By: Franziska Hinkelmann <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent cfdcd6c commit c8be718

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

deps/v8/include/v8.h

+8
Original file line numberDiff line numberDiff line change
@@ -4008,12 +4008,20 @@ class V8_EXPORT ArrayBuffer : public Object {
40084008
*/
40094009
virtual void* AllocateUninitialized(size_t length) = 0;
40104010

4011+
virtual void* Reserve(size_t length);
4012+
40114013
/**
40124014
* Free the memory block of size |length|, pointed to by |data|.
40134015
* That memory is guaranteed to be previously allocated by |Allocate|.
40144016
*/
40154017
virtual void Free(void* data, size_t length) = 0;
40164018

4019+
enum class AllocationMode { kNormal, kReservation };
4020+
virtual void Free(void* data, size_t length, AllocationMode mode);
4021+
enum class Protection { kNoAccess, kReadWrite };
4022+
virtual void SetProtection(void* data, size_t length,
4023+
Protection protection);
4024+
40174025
/**
40184026
* malloc/free based convenience allocator.
40194027
*

deps/v8/src/api.cc

+13
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,19 @@ void V8::SetSnapshotDataBlob(StartupData* snapshot_blob) {
437437
i::V8::SetSnapshotBlob(snapshot_blob);
438438
}
439439

440+
void* v8::ArrayBuffer::Allocator::Reserve(size_t length) { UNIMPLEMENTED(); }
441+
442+
void v8::ArrayBuffer::Allocator::Free(void* data, size_t length,
443+
AllocationMode mode) {
444+
UNIMPLEMENTED();
445+
}
446+
447+
void v8::ArrayBuffer::Allocator::SetProtection(
448+
void* data, size_t length,
449+
v8::ArrayBuffer::Allocator::Protection protection) {
450+
UNIMPLEMENTED();
451+
}
452+
440453
namespace {
441454

442455
class ArrayBufferAllocator : public v8::ArrayBuffer::Allocator {

0 commit comments

Comments
 (0)