Make the global packet_buffer owned by common (#8073)

This commit is contained in:
Vincent Stumpf 2024-01-01 10:05:21 -08:00 committed by GitHub
parent 3756872529
commit 1c31d9c83e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View File

@ -47,6 +47,10 @@
#include "strlib.hpp" #include "strlib.hpp"
#include "timer.hpp" #include "timer.hpp"
// Reuseable global packet buffer to prevent too many allocations
// Take socket.cpp::socket_max_client_packet into consideration
int8 packet_buffer[UINT16_MAX];
///////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////
#if defined(WIN32) #if defined(WIN32)
///////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////

View File

@ -201,7 +201,7 @@ void send_shortlist_do_sends();
// Reuseable global packet buffer to prevent too many allocations // Reuseable global packet buffer to prevent too many allocations
// Take socket.cpp::socket_max_client_packet into consideration // Take socket.cpp::socket_max_client_packet into consideration
static int8 packet_buffer[UINT16_MAX]; extern int8 packet_buffer[UINT16_MAX];
template <typename P> template <typename P>
bool socket_send( int fd, P& packet ){ bool socket_send( int fd, P& packet ){