renamed to PreAlloc instead of PreMalloc

This commit is contained in:
HuYingzhuo(hugo/hyzboy) 2023-07-21 11:14:38 +08:00
parent e79c592464
commit ecafcad136
2 changed files with 4 additions and 3 deletions

View File

@ -8,7 +8,7 @@ namespace hgl
{ {
namespace namespace
{ {
void PreMalloc(IPAddressStack &ip_stack,ServerSocket *server) void PreAlloc(IPAddressStack &ip_stack,ServerSocket *server)
{ {
int count=ip_stack.GetCount(); int count=ip_stack.GetCount();
@ -28,7 +28,7 @@ namespace hgl
if(!server) if(!server)
return; return;
PreMalloc(ip_stack,server); PreAlloc(ip_stack,server);
} }
bool AcceptThread::Execute() bool AcceptThread::Execute()
@ -39,7 +39,7 @@ namespace hgl
int client_sock; int client_sock;
if(ip_stack.GetCount()<=0) if(ip_stack.GetCount()<=0)
PreMalloc(ip_stack,server); PreAlloc(ip_stack,server);
ip_stack.Pop(client_ip); ip_stack.Pop(client_ip);

View File

@ -3,6 +3,7 @@
#include<hgl/network/TCPSocket.h> #include<hgl/network/TCPSocket.h>
#include<hgl/type/DataArray.h> #include<hgl/type/DataArray.h>
#include<hgl/log/LogInfo.h> #include<hgl/log/LogInfo.h>
namespace hgl namespace hgl
{ {
namespace network namespace network