This commit is contained in:
azw 2023-05-08 10:59:56 +00:00
parent 7dbabffa09
commit 8cdb6d26ce
3 changed files with 4 additions and 13 deletions

View File

@ -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)

View File

@ -1,6 +1,7 @@
#pragma once
#include <a8/singleton.h>
#include <a8/orderbuffer.h>
class MMCache : public a8::Singleton<MMCache>
{
@ -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<a8::OrderBuffer> socket_msg_buffer_;
std::shared_ptr<a8::OrderBuffer> udp_msg_buffer_;
};

2
third_party/a8 vendored

@ -1 +1 @@
Subproject commit 466448796dff77a16190519c25879cfe0bc534ec
Subproject commit 543969a5e8592016922ae5429a28941d00a0bd10