Skip to content
This repository was archived by the owner on Mar 29, 2024. It is now read-only.

Commit ffa8f19

Browse files
committed
Fix obj and func templates external memory adjusting
1 parent 2ad2c3e commit ffa8f19

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

src/php_v8_ext_mem_interface.cc

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -52,20 +52,19 @@ void php_v8_ext_mem_interface_function_template_AdjustExternalAllocatedMemory(IN
5252
if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &change_in_bytes) == FAILURE) {
5353
return;
5454
}
55+
PHP_V8_FUNCTION_TEMPLATE_FETCH_INTO(getThis(), php_v8_function_template);
5556

56-
PHP_V8_OBJECT_TEMPLATE_FETCH_INTO(getThis(), php_v8_object_template);
57-
58-
RETURN_LONG(php_v8_object_template->persistent_data->adjustSize(change_in_bytes));
57+
RETURN_LONG(php_v8_function_template->persistent_data->adjustSize(change_in_bytes));
5958
}
6059

6160
void php_v8_ext_mem_interface_function_template_GetExternalAllocatedMemory(INTERNAL_FUNCTION_PARAMETERS) {
6261
if (zend_parse_parameters_none() == FAILURE) {
6362
return;
6463
}
6564

66-
PHP_V8_OBJECT_TEMPLATE_FETCH_INTO(getThis(), php_v8_object_template);
65+
PHP_V8_FUNCTION_TEMPLATE_FETCH_INTO(getThis(), php_v8_function_template);
6766

68-
RETURN_LONG(php_v8_object_template->persistent_data->getAdjustedSize());
67+
RETURN_LONG(php_v8_function_template->persistent_data->getAdjustedSize());
6968
}
7069

7170

@@ -76,19 +75,19 @@ void php_v8_ext_mem_interface_object_template_AdjustExternalAllocatedMemory(INTE
7675
return;
7776
}
7877

79-
PHP_V8_FUNCTION_TEMPLATE_FETCH_INTO(getThis(), php_v8_function_template);
78+
PHP_V8_OBJECT_TEMPLATE_FETCH_INTO(getThis(), php_v8_object_template);
8079

81-
RETURN_LONG(php_v8_function_template->persistent_data->adjustSize(change_in_bytes));
80+
RETURN_LONG(php_v8_object_template->persistent_data->adjustSize(change_in_bytes));
8281
}
8382

8483
void php_v8_ext_mem_interface_object_template_GetExternalAllocatedMemory(INTERNAL_FUNCTION_PARAMETERS) {
8584
if (zend_parse_parameters_none() == FAILURE) {
8685
return;
8786
}
8887

89-
PHP_V8_FUNCTION_TEMPLATE_FETCH_INTO(getThis(), php_v8_function_template);
88+
PHP_V8_OBJECT_TEMPLATE_FETCH_INTO(getThis(), php_v8_object_template);
9089

91-
RETURN_LONG(php_v8_function_template->persistent_data->getAdjustedSize());
90+
RETURN_LONG(php_v8_object_template->persistent_data->getAdjustedSize());
9291
}
9392

9493

0 commit comments

Comments
 (0)