Skip to content

Commit 303fec6

Browse files
committed
add vips_cache_set_*()
and vips_concurrency_set()
1 parent 5b52cc3 commit 303fec6

File tree

2 files changed

+78
-0
lines changed

2 files changed

+78
-0
lines changed

ChangeLog

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ Version 0.1.1 (2016-10-03)
88
* Vips_image_get() returns ["out" => value] | -1
99
* Fix type conversions
1010
* Add vips_image_remove()
11+
* Add vips_cache_set_*()
12+
* Add vips_concurrency_set()
1113

1214
Version 0.1.0 (2016-09-20)
1315
--------------------------

vips.c

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1438,6 +1438,62 @@ PHP_FUNCTION(vips_error_buffer)
14381438
}
14391439
/* }}} */
14401440

1441+
/* {{{ proto void vips_cache_set_max(integer value)
1442+
Set max number of operations to cache */
1443+
PHP_FUNCTION(vips_cache_set_max)
1444+
{
1445+
long value;
1446+
1447+
if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &value) == FAILURE) {
1448+
return;
1449+
}
1450+
1451+
vips_cache_set_max(value);
1452+
}
1453+
/* }}} */
1454+
1455+
/* {{{ proto void vips_cache_set_max_mem(integer value)
1456+
Set max memory to use for operation cache */
1457+
PHP_FUNCTION(vips_cache_set_max_mem)
1458+
{
1459+
long value;
1460+
1461+
if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &value) == FAILURE) {
1462+
return;
1463+
}
1464+
1465+
vips_cache_set_max_mem(value);
1466+
}
1467+
/* }}} */
1468+
1469+
/* {{{ proto void vips_cache_set_max_files(integer value)
1470+
Set max number of open files for operation cache */
1471+
PHP_FUNCTION(vips_cache_set_max_files)
1472+
{
1473+
long value;
1474+
1475+
if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &value) == FAILURE) {
1476+
return;
1477+
}
1478+
1479+
vips_cache_set_max_files(value);
1480+
}
1481+
/* }}} */
1482+
1483+
/* {{{ proto void vips_concurrency_set(integer value)
1484+
Set number of workers per threadpool */
1485+
PHP_FUNCTION(vips_concurrency_set)
1486+
{
1487+
long value;
1488+
1489+
if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &value) == FAILURE) {
1490+
return;
1491+
}
1492+
1493+
vips_concurrency_set(value);
1494+
}
1495+
/* }}} */
1496+
14411497
/* {{{ php_vips_init_globals
14421498
*/
14431499
/* Uncomment this function if you have INI entries
@@ -1588,6 +1644,22 @@ ZEND_END_ARG_INFO()
15881644
ZEND_BEGIN_ARG_INFO(arginfo_vips_error_buffer, 0)
15891645
ZEND_END_ARG_INFO()
15901646

1647+
ZEND_BEGIN_ARG_INFO(arginfo_vips_cache_set_max, 0)
1648+
ZEND_ARG_INFO(0, value)
1649+
ZEND_END_ARG_INFO()
1650+
1651+
ZEND_BEGIN_ARG_INFO(arginfo_vips_cache_set_max_mem, 0)
1652+
ZEND_ARG_INFO(0, value)
1653+
ZEND_END_ARG_INFO()
1654+
1655+
ZEND_BEGIN_ARG_INFO(arginfo_vips_cache_set_max_files, 0)
1656+
ZEND_ARG_INFO(0, value)
1657+
ZEND_END_ARG_INFO()
1658+
1659+
ZEND_BEGIN_ARG_INFO(arginfo_vips_concurrency_set, 0)
1660+
ZEND_ARG_INFO(0, value)
1661+
ZEND_END_ARG_INFO()
1662+
15911663
/* {{{ vips_functions[]
15921664
*
15931665
* Every user visible function must have an entry in vips_functions[].
@@ -1604,6 +1676,10 @@ const zend_function_entry vips_functions[] = {
16041676
PHP_FE(vips_image_set, arginfo_vips_image_set)
16051677
PHP_FE(vips_image_remove, arginfo_vips_image_remove)
16061678
PHP_FE(vips_error_buffer, arginfo_vips_error_buffer)
1679+
PHP_FE(vips_cache_set_max, arginfo_vips_cache_set_max)
1680+
PHP_FE(vips_cache_set_max_mem, arginfo_vips_cache_set_max_mem)
1681+
PHP_FE(vips_cache_set_max_files, arginfo_vips_cache_set_max_files)
1682+
PHP_FE(vips_concurrency_set, arginfo_vips_concurrency_set)
16071683

16081684
PHP_FE_END /* Must be the last line in vips_functions[] */
16091685
};

0 commit comments

Comments
 (0)