V8 Project
v8::MockArrayBufferAllocator Class Reference
+ Inheritance diagram for v8::MockArrayBufferAllocator:
+ Collaboration diagram for v8::MockArrayBufferAllocator:

Public Member Functions

virtual void * Allocate (size_t) OVERRIDE
 Allocate |length| bytes. More...
 
virtual void * AllocateUninitialized (size_t length) OVERRIDE
 Allocate |length| bytes. More...
 
virtual void Free (void *p, size_t) OVERRIDE
 Free the memory block of size |length|, pointed to by |data|. More...
 
- Public Member Functions inherited from v8::ArrayBuffer::Allocator
virtual ~Allocator ()
 

Detailed Description

Definition at line 1536 of file d8.cc.

Member Function Documentation

◆ Allocate()

virtual void* v8::MockArrayBufferAllocator::Allocate ( size_t  length)
inlinevirtual

Allocate |length| bytes.

Return NULL if allocation is not successful. Memory should be initialized to zeroes.

Implements v8::ArrayBuffer::Allocator.

Definition at line 1538 of file d8.cc.

1538  {
1539  return malloc(0);
1540  }

◆ AllocateUninitialized()

virtual void* v8::MockArrayBufferAllocator::AllocateUninitialized ( size_t  length)
inlinevirtual

Allocate |length| bytes.

Return NULL if allocation is not successful. Memory does not have to be initialized.

Implements v8::ArrayBuffer::Allocator.

Definition at line 1541 of file d8.cc.

1541  {
1542  return malloc(0);
1543  }

◆ Free()

virtual void v8::MockArrayBufferAllocator::Free ( void *  data,
size_t  length 
)
inlinevirtual

Free the memory block of size |length|, pointed to by |data|.

That memory is guaranteed to be previously allocated by |Allocate|.

Implements v8::ArrayBuffer::Allocator.

Definition at line 1544 of file d8.cc.

1544  {
1545  free(p);
1546  }

The documentation for this class was generated from the following file: