0
0
mirror of https://github.com/phpv8/v8js.git synced 2024-11-09 22:08:40 +00:00

Call v8::V8::SetArrayBufferAllocator for v8 4.4.10 & higher

This commit is contained in:
Stefan Siegl 2015-07-25 17:28:08 +02:00
parent 493e448bae
commit 22e90d1c50

View File

@ -65,7 +65,7 @@ struct v8js_jsext {
}; };
/* }}} */ /* }}} */
#if PHP_V8_API_VERSION >= 4004044 #if PHP_V8_API_VERSION >= 4004010
class ArrayBufferAllocator : public v8::ArrayBuffer::Allocator { class ArrayBufferAllocator : public v8::ArrayBuffer::Allocator {
public: public:
virtual void* Allocate(size_t length) { virtual void* Allocate(size_t length) {
@ -1071,6 +1071,11 @@ PHP_MINIT_FUNCTION(v8js_class) /* {{{ */
le_v8js_script = zend_register_list_destructors_ex(v8js_script_dtor, NULL, PHP_V8JS_SCRIPT_RES_NAME, module_number); le_v8js_script = zend_register_list_destructors_ex(v8js_script_dtor, NULL, PHP_V8JS_SCRIPT_RES_NAME, module_number);
#if PHP_V8_API_VERSION >= 4004010 && PHP_V8_API_VERSION < 4004044
static ArrayBufferAllocator array_buffer_allocator;
v8::V8::SetArrayBufferAllocator(&array_buffer_allocator);
#endif
return SUCCESS; return SUCCESS;
} /* }}} */ } /* }}} */