|
@@ -733,9 +733,7 @@ static void *manager_thread(void *arg) {
|
|
|
exit(EXIT_FAILURE);
|
|
|
}
|
|
|
|
|
|
- int num_threads = *((int *)arg);
|
|
|
- free(arg);
|
|
|
- arg = NULL;
|
|
|
+ intptr_t num_threads = (intptr_t)arg;
|
|
|
|
|
|
#ifdef ZTS
|
|
|
#if (PHP_VERSION_ID >= 80300)
|
|
@@ -796,11 +794,8 @@ static void *manager_thread(void *arg) {
|
|
|
int frankenphp_init(int num_threads) {
|
|
|
pthread_t thread;
|
|
|
|
|
|
- int *num_threads_ptr = calloc(1, sizeof(int));
|
|
|
- *num_threads_ptr = num_threads;
|
|
|
-
|
|
|
- if (pthread_create(&thread, NULL, *manager_thread, (void *)num_threads_ptr) !=
|
|
|
- 0) {
|
|
|
+ if (pthread_create(&thread, NULL, *manager_thread,
|
|
|
+ (void *)(intptr_t)num_threads) != 0) {
|
|
|
go_shutdown();
|
|
|
|
|
|
return -1;
|