summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryangwei <[email protected]>2024-08-01 13:57:37 +0800
committerluwenpeng <[email protected]>2024-08-12 15:45:50 +0800
commit0deeb7f3e739f4e4d43253596784d244d54bddf3 (patch)
tree17aa38e7961112d11ca4128d3596cc06e02cd0c6
parent49539eb2533017a0865d804d9592db2df3f659f0 (diff)
🎈 perf(timer, packet_io_yield): update parameter
-rw-r--r--src/stellar/stellar_core.cpp2
-rw-r--r--src/tcp_reassembly/tcp_reassembly.cpp2
-rw-r--r--src/times/times.cpp2
3 files changed, 3 insertions, 3 deletions
diff --git a/src/stellar/stellar_core.cpp b/src/stellar/stellar_core.cpp
index cf3639e..465998a 100644
--- a/src/stellar/stellar_core.cpp
+++ b/src/stellar/stellar_core.cpp
@@ -289,7 +289,7 @@ static void *work_thread(void *arg)
if (nr_recv == 0)
{
- packet_io_yield(packet_io, thr_idx, 10);
+ packet_io_yield(packet_io, thr_idx, 900);
}
}
diff --git a/src/tcp_reassembly/tcp_reassembly.cpp b/src/tcp_reassembly/tcp_reassembly.cpp
index 61a5b14..f7cc978 100644
--- a/src/tcp_reassembly/tcp_reassembly.cpp
+++ b/src/tcp_reassembly/tcp_reassembly.cpp
@@ -55,7 +55,7 @@ void tcp_segment_free(struct tcp_segment *seg)
struct tcp_reassembly *tcp_reassembly_new(uint64_t max_timeout, uint64_t max_seg_num)
{
- struct tcp_reassembly *assembler = (struct tcp_reassembly *)calloc(1, sizeof(struct tcp_reassembly));
+ struct tcp_reassembly *assembler = (struct tcp_reassembly *)malloc(sizeof(struct tcp_reassembly));
if (!assembler)
{
TCP_REASSEMBLY_LOG_ERROR("calloc failed");
diff --git a/src/times/times.cpp b/src/times/times.cpp
index 2289e11..be4cdec 100644
--- a/src/times/times.cpp
+++ b/src/times/times.cpp
@@ -58,7 +58,7 @@ uint64_t stellar_get_real_time_sec()
uint64_t stellar_get_real_time_msec()
{
struct timespec now;
- clock_gettime(CLOCK_REALTIME, &now);
+ clock_gettime(CLOCK_REALTIME_COARSE, &now);
return TIMESPEC_TO_MSEC(now);
}