Skip to content

Commit 619c903

Browse files
perf: nocallback and noescape cgo flags (php#1406)
1 parent 7882410 commit 619c903

4 files changed

Lines changed: 16 additions & 0 deletions

File tree

cgi.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
package frankenphp
22

3+
// #cgo nocallback frankenphp_register_bulk
4+
// #cgo nocallback frankenphp_register_variables_from_request_info
5+
// #cgo nocallback frankenphp_register_variable_safe
6+
// #cgo nocallback frankenphp_register_single
7+
// #cgo noescape frankenphp_register_bulk
8+
// #cgo noescape frankenphp_register_variables_from_request_info
9+
// #cgo noescape frankenphp_register_variable_safe
10+
// #cgo noescape frankenphp_register_single
311
// #include <php_variables.h>
412
// #include "frankenphp.h"
513
import "C"

frankenphp.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ package frankenphp
1212
//
1313
// We also set these flags for hardening: https://github.com/docker-library/php/blob/master/8.2/bookworm/zts/Dockerfile#L57-L59
1414

15+
// #cgo nocallback frankenphp_update_server_context
16+
// #cgo noescape frankenphp_update_server_context
1517
// #cgo darwin pkg-config: libxml-2.0
1618
// #cgo CFLAGS: -Wall -Werror
1719
// #cgo CFLAGS: -I/usr/local/include -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib

phpmainthread.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
package frankenphp
22

3+
// #cgo nocallback frankenphp_new_main_thread
4+
// #cgo nocallback frankenphp_init_persistent_string
5+
// #cgo noescape frankenphp_new_main_thread
6+
// #cgo noescape frankenphp_init_persistent_string
7+
// #include <php_variables.h>
38
// #include "frankenphp.h"
49
import "C"
510
import (

phpthread.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package frankenphp
22

3+
// #cgo nocallback frankenphp_new_php_thread
34
// #include "frankenphp.h"
45
import "C"
56
import (

0 commit comments

Comments
 (0)