Skip to content
Snippets Groups Projects
Commit c28c9843 authored by Roman Khlopkov's avatar Roman Khlopkov 🔜
Browse files

[*] DAP_DUP redefine & usage

parent e68e0970
No related branches found
No related tags found
1 merge request!337hotfix-4898
Pipeline #8248 passed with stage
in 5 seconds
......@@ -122,8 +122,8 @@ typedef uint8_t byte_t;
#define DAP_NEW_Z_SIZE(a, b) DAP_CAST_REINT(a, rpcalloc(1,b))
#define DAP_REALLOC(a, b) rprealloc(a,b)
#define DAP_DELETE(a) rpfree(a)
#define DAP_DUP(a) ( __typeof(a) ret = memcpy(ret,a,sizeof(*a)) )
#define DAP_DUP_SIZE(a,b) ( __typeof(a) ret = memcpy(ret,a,b) )
#define DAP_DUP(a, b) memcpy(a, b, sizeof(*b))
#define DAP_DUP_SIZE(a, b, s) memcpy(a, b, s)
#else
#define DAP_MALLOC(a) malloc(a)
#define DAP_FREE(a) free(a)
......@@ -139,8 +139,8 @@ typedef uint8_t byte_t;
#define DAP_NEW_Z_SIZE(a, b) DAP_CAST_REINT(a, calloc(1,b))
#define DAP_REALLOC(a, b) realloc(a,b)
#define DAP_DELETE(a) free(a)
#define DAP_DUP(a) ( __typeof(a) ret = memcpy(ret,a,sizeof(*a)) )
#define DAP_DUP_SIZE(a,b) ( __typeof(a) memcpy(ret,a,b) )
#define DAP_DUP(a, b) memcpy(a, b, sizeof(*b))
#define DAP_DUP_SIZE(a, b, s) memcpy(a, b, s)
#endif
#define DAP_DEL_Z(a) if(a) { DAP_DELETE(a); a=NULL;}
......
......@@ -181,8 +181,6 @@ static void s_stage_status_error_callback(dap_client_t *a_client, void *a_arg)
static void s_node_client_connected_synchro_start_callback(dap_worker_t *a_worker, void *a_arg)
{
UNUSED(a_worker);
dap_events_socket_uuid_t *l_uuid = DAP_NEW(dap_events_socket_uuid_t);
memcpy(l_uuid, a_arg, sizeof(dap_events_socket_uuid_t));
if (s_timer_update_states_callback(a_arg))
DAP_DELETE(l_uuid);
}
......@@ -281,9 +279,11 @@ static void s_stage_connected_callback(dap_client_t *a_client, void *a_arg)
l_node_client->stream_worker = l_stream->stream_worker;
if (l_node_client->keep_connection) {
dap_events_socket_uuid_t *l_uuid = DAP_NEW(dap_events_socket_uuid_t);
memcpy(l_uuid, &l_node_client->uuid, sizeof(dap_events_socket_uuid_t));
DAP_DUP(l_uuid, &l_node_client->uuid);
dap_worker_exec_callback_on(l_stream->esocket->worker, s_node_client_connected_synchro_start_callback, l_uuid);
dap_timerfd_start_on_worker(l_stream->esocket->worker, s_timer_update_states * 1000, s_timer_update_states_callback, l_uuid);
dap_events_socket_uuid_t *l_uuid_timer = DAP_NEW(dap_events_socket_uuid_t);
DAP_DUP(l_uuid_timer, &l_node_client->uuid);
dap_timerfd_start_on_worker(l_stream->esocket->worker, s_timer_update_states * 1000, s_timer_update_states_callback, l_uuid_timer);
}
}
#ifndef _WIN32
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment