This commit is contained in:
azw 2023-05-08 05:03:30 +00:00
parent 56640c5554
commit 7dbabffa09
2 changed files with 10 additions and 2 deletions

View File

@ -4,12 +4,18 @@
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)

View File

@ -22,6 +22,8 @@ public:
private:
char* socket_msg_buf_ = nullptr;
int socket_msg_buf_len_ = 1024;
char* udp_msg_buf_ = nullptr;
int udp_msg_buf_len_ = 1024;
};