From 8cdb6d26ceece2738a029109e3253c45e0693215 Mon Sep 17 00:00:00 2001 From: azw Date: Mon, 8 May 2023 10:59:56 +0000 Subject: [PATCH] 1 --- server/wsproxy/mmcache.cc | 8 -------- server/wsproxy/mmcache.h | 7 +++---- third_party/a8 | 2 +- 3 files changed, 4 insertions(+), 13 deletions(-) diff --git a/server/wsproxy/mmcache.cc b/server/wsproxy/mmcache.cc index 78d0858..0455406 100644 --- a/server/wsproxy/mmcache.cc +++ b/server/wsproxy/mmcache.cc @@ -4,18 +4,10 @@ void MMCache::Init() { - socket_msg_buf_len_ = 1024 * 1024; - udp_msg_buf_len_ = 1024 * 1024; - socket_msg_buf_ = (char*)malloc(socket_msg_buf_len_); - udp_msg_buf_ = (char*)malloc(udp_msg_buf_len_); } void MMCache::UnInit() { - free(socket_msg_buf_); - socket_msg_buf_ = nullptr; - free(udp_msg_buf_); - udp_msg_buf_ = nullptr; } char* MMCache::AllocSocketMsg(int len) diff --git a/server/wsproxy/mmcache.h b/server/wsproxy/mmcache.h index d2a355b..0c2f683 100644 --- a/server/wsproxy/mmcache.h +++ b/server/wsproxy/mmcache.h @@ -1,6 +1,7 @@ #pragma once #include +#include class MMCache : public a8::Singleton { @@ -21,9 +22,7 @@ public: private: - char* socket_msg_buf_ = nullptr; - int socket_msg_buf_len_ = 1024; - char* udp_msg_buf_ = nullptr; - int udp_msg_buf_len_ = 1024; + std::shared_ptr socket_msg_buffer_; + std::shared_ptr udp_msg_buffer_; }; diff --git a/third_party/a8 b/third_party/a8 index 4664487..543969a 160000 --- a/third_party/a8 +++ b/third_party/a8 @@ -1 +1 @@ -Subproject commit 466448796dff77a16190519c25879cfe0bc534ec +Subproject commit 543969a5e8592016922ae5429a28941d00a0bd10