Skip to content

Commit 7aaaa33

Browse files
committed
async: drop separate Async API versioning; rely on ZEND_MODULE_API_NO
1 parent 7a8f154 commit 7aaaa33

3 files changed

Lines changed: 4 additions & 28 deletions

File tree

Zend/zend_async_API.c

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -308,12 +308,6 @@ ZEND_API bool zend_async_scheduler_register(
308308
return false;
309309
}
310310

311-
if ((api->version >> 16) != ZEND_ASYNC_API_VERSION_MAJOR) {
312-
zend_error(E_CORE_WARNING,
313-
"Module %s was compiled against an incompatible Async API version", module);
314-
return false;
315-
}
316-
317311
/* A scheduler is registered once per process. */
318312
if (scheduler_module_name != NULL) {
319313
zend_error(E_CORE_WARNING,
@@ -400,15 +394,6 @@ ZEND_API const char *zend_async_get_scheduler_module(void)
400394
return scheduler_module_name;
401395
}
402396

403-
ZEND_API const char *zend_async_get_api_version(void)
404-
{
405-
return ZEND_ASYNC_API;
406-
}
407-
408-
ZEND_API int zend_async_get_api_version_number(void)
409-
{
410-
return ZEND_ASYNC_API_VERSION_NUMBER;
411-
}
412397

413398
ZEND_API void zend_async_scheduler_unregister(void)
414399
{

Zend/zend_async_API.h

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,6 @@
2626
* provider's business; the core only offers the awaiting_info hook so
2727
* that the wait state can be inspected for diagnostics.
2828
*/
29-
#define ZEND_ASYNC_API "AsyncCore ABI v0.1.0"
30-
#define ZEND_ASYNC_API_VERSION_MAJOR 0
31-
#define ZEND_ASYNC_API_VERSION_MINOR 1
32-
#define ZEND_ASYNC_API_VERSION_PATCH 0
33-
34-
#define ZEND_ASYNC_API_VERSION_NUMBER \
35-
((ZEND_ASYNC_API_VERSION_MAJOR << 16) | (ZEND_ASYNC_API_VERSION_MINOR << 8) \
36-
| (ZEND_ASYNC_API_VERSION_PATCH))
3729

3830
typedef struct _zend_coroutine_s zend_coroutine_t;
3931
typedef struct _zend_async_context_s zend_async_context_t;
@@ -357,12 +349,14 @@ typedef bool (*zend_async_gc_destructors_t)(zend_async_gc_run_dtors_fn run);
357349
typedef zend_coroutine_t *(*zend_async_intercept_fiber_t)(zend_fiber *fiber);
358350

359351
/**
360-
* Versioned scheduler API bundle. A provider fills the struct and calls
352+
* Scheduler API bundle. A provider fills the struct and calls
361353
* zend_async_scheduler_register(). New slots are appended at the end only;
362354
* `size` lets the core detect how much of the struct the provider knows.
355+
* ABI compatibility rides on the standard PHP module API (ZEND_MODULE_API_NO),
356+
* enforced when the provider extension is loaded — there is no separate
357+
* Async API version.
363358
*/
364359
typedef struct _zend_async_scheduler_api_s {
365-
uint32_t version; /* ZEND_ASYNC_API_VERSION_NUMBER the provider was built against */
366360
size_t size; /* sizeof(zend_async_scheduler_api_t) at provider build time */
367361

368362
zend_async_new_coroutine_t new_coroutine;
@@ -427,8 +421,6 @@ ZEND_API void zend_async_scheduler_unregister(void);
427421
ZEND_API bool zend_async_is_enabled(void);
428422
/* The module name of the registered scheduler, or NULL when none. */
429423
ZEND_API const char *zend_async_get_scheduler_module(void);
430-
ZEND_API const char *zend_async_get_api_version(void);
431-
ZEND_API int zend_async_get_api_version_number(void);
432424

433425
END_EXTERN_C()
434426

Zend/zend_scheduler_hook.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,6 @@ static void php_async_handlers_reset(void)
395395
static void php_async_build_api(zend_async_scheduler_api_t *api)
396396
{
397397
memset(api, 0, sizeof(*api));
398-
api->version = ZEND_ASYNC_API_VERSION_NUMBER;
399398
api->size = sizeof(*api);
400399

401400
if (PHP_ASYNC_HOOK(PHP_ASYNC_HOOK_LAUNCH)->set) {

0 commit comments

Comments
 (0)