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) {
161
161
162
162
zend_object_std_dtor (&php_v8_isolate->std );
163
163
164
- if (php_v8_isolate->array_buffer_allocator ) {
165
- delete php_v8_isolate->array_buffer_allocator ;
166
- }
167
-
168
164
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
+
169
169
delete php_v8_isolate->create_params ;
170
170
}
171
171
}
@@ -182,10 +182,8 @@ static zend_object *php_v8_isolate_ctor(zend_class_entry *ce) {
182
182
// TODO: inline? module init?
183
183
php_v8_init ();
184
184
185
- php_v8_isolate->array_buffer_allocator = new ArrayBufferAllocator ();
186
185
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 ();
189
187
190
188
php_v8_isolate->weak_function_templates = new std::map<v8::Persistent<v8::FunctionTemplate> *, php_v8_callbacks_t *>();
191
189
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);
117
117
} \
118
118
119
119
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
-
130
120
struct _php_v8_isolate_t {
131
121
v8::Isolate *isolate;
132
- ArrayBufferAllocator *array_buffer_allocator;
133
122
v8::Isolate::CreateParams *create_params;
134
123
135
124
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