Skip to content

Commit a1cdd75

Browse files
committed
Fix conditional compilation for snapshot=off
1 parent 93d3f95 commit a1cdd75

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

v8js_class.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ static void v8js_free_storage(void *object TSRMLS_DC) /* {{{ */
207207
c->modules_stack.~vector();
208208
c->modules_base.~vector();
209209

210-
#ifdef PHP_V8_USE_EXTERNAL_STARTUP_DATA
210+
#if defined(PHP_V8_USE_EXTERNAL_STARTUP_DATA) && PHP_V8_API_VERSION >= 4004044
211211
if (c->snapshot_blob.data) {
212212
efree((void*)c->snapshot_blob.data);
213213
}
@@ -369,8 +369,8 @@ static PHP_METHOD(V8Js, __construct)
369369
new (&c->create_params) v8::Isolate::CreateParams();
370370
c->create_params.array_buffer_allocator = &array_buffer_allocator;
371371

372-
new (&c->snapshot_blob) v8::StartupData();
373372
#ifdef PHP_V8_USE_EXTERNAL_STARTUP_DATA
373+
new (&c->snapshot_blob) v8::StartupData();
374374
if (snapshot_blob && snapshot_blob_len) {
375375
c->snapshot_blob.data = snapshot_blob;
376376
c->snapshot_blob.raw_size = snapshot_blob_len;

0 commit comments

Comments
 (0)