This commit is contained in:
jeka committed 2026-04-15 09:00:12 +03:00
1 parent 88b1eb65e7
commit d0db32badd
2 files changed
-26

No files matched your search

-25
View File
@@ -1511,31 +1511,6 @@ void uasync_destroy(struct UASYNC* ua, int close_fds) {
socket_platform_cleanup();
}
void uasync_init_instance(struct UASYNC* ua) {
if (!ua) return;
// Initialize socket array if not present
if (!ua->sockets) {
ua->sockets = socket_array_create(16);
}
if (!ua->timeout_pool) {
ua->timeout_pool = memory_pool_init(sizeof(struct timeout_node));
}
if (!ua->immediate_queue_head) {
ua->immediate_queue_head = NULL;
ua->immediate_queue_tail = NULL;
}
if (!ua->timeout_heap) {
ua->timeout_heap = timeout_heap_create(16);
if (ua->timeout_heap) {
timeout_heap_set_free_callback(ua->timeout_heap, ua, timeout_node_free_callback);
}
}
}
// Debug statistics
void uasync_get_stats(struct UASYNC* ua, size_t* timer_alloc, size_t* timer_u_free, size_t* socket_alloc, size_t* socket_u_free) {
if (!ua) return;
-1
View File
@@ -77,7 +77,6 @@ typedef struct UASYNC UASYNC_t;
// Instance API - основной API для работы с uasync
struct UASYNC* uasync_create(void);
void uasync_destroy(struct UASYNC* ua, int close_fds);
void uasync_init_instance(struct UASYNC* ua);
// текущее время (timebase 0.1ms)
uint64_t get_time_tb(void);