This repository was archived by the owner on Mar 29, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +5
-18
lines changed Expand file tree Collapse file tree 2 files changed +5
-18
lines changed Original file line number Diff line number Diff line change @@ -161,11 +161,11 @@ static void php_v8_isolate_free(zend_object *object) {
161161
162162 zend_object_std_dtor (&php_v8_isolate->std );
163163
164- if (php_v8_isolate->array_buffer_allocator ) {
165- delete php_v8_isolate->array_buffer_allocator ;
166- }
167-
168164 if (php_v8_isolate->create_params ) {
165+ if (php_v8_isolate->create_params ->array_buffer_allocator ) {
166+ delete php_v8_isolate->create_params ->array_buffer_allocator ;
167+ }
168+
169169 delete php_v8_isolate->create_params ;
170170 }
171171}
@@ -182,10 +182,8 @@ static zend_object *php_v8_isolate_ctor(zend_class_entry *ce) {
182182 // TODO: inline? module init?
183183 php_v8_init ();
184184
185- php_v8_isolate->array_buffer_allocator = new ArrayBufferAllocator ();
186185 php_v8_isolate->create_params = new v8::Isolate::CreateParams ();
187-
188- php_v8_isolate->create_params ->array_buffer_allocator = php_v8_isolate->array_buffer_allocator ;
186+ php_v8_isolate->create_params ->array_buffer_allocator = v8::ArrayBuffer::Allocator::NewDefaultAllocator ();
189187
190188 php_v8_isolate->weak_function_templates = new std::map<v8::Persistent<v8::FunctionTemplate> *, php_v8_callbacks_t *>();
191189 php_v8_isolate->weak_object_templates = new std::map<v8::Persistent<v8::ObjectTemplate> *, php_v8_callbacks_t *>();
Original file line number Diff line number Diff line change @@ -117,19 +117,8 @@ extern php_v8_isolate_t * php_v8_isolate_fetch_object(zend_object *obj);
117117 } \
118118
119119
120- class ArrayBufferAllocator : public v8 ::ArrayBuffer::Allocator {
121- public:
122- virtual void * Allocate (size_t length) {
123- void * data = AllocateUninitialized (length);
124- return data == NULL ? data : memset (data, 0 , length);
125- }
126- virtual void * AllocateUninitialized (size_t length) { return malloc (length); }
127- virtual void Free (void * data, size_t ) { free (data); }
128- };
129-
130120struct _php_v8_isolate_t {
131121 v8::Isolate *isolate;
132- ArrayBufferAllocator *array_buffer_allocator;
133122 v8::Isolate::CreateParams *create_params;
134123
135124 std::map<v8::Persistent<v8::FunctionTemplate>*, php_v8_callbacks_t *> *weak_function_templates;
You can’t perform that action at this time.
0 commit comments