got TcpServer and Thread to inherit Mmged

This commit is contained in:
2018-07-01 02:11:33 +00:00
parent 1d12ec3e3f
commit 27039d9693
13 changed files with 118 additions and 98 deletions

View File

@ -3,7 +3,7 @@
#include <qse/si/sio.h>
#include <qse/si/os.h>
#include <qse/cmn/mem.h>
#include <qse/cmn/HeapMmgr.hpp>
#include <locale.h>
#if defined(_WIN32)
@ -51,6 +51,8 @@ static QSE::TcpServerF<ClientHandler>* g_server;
static int test1 (void)
{
QSE::HeapMmgr heap_mmgr (QSE::Mmgr::getDFL(), 30000);
#if defined(QSE_LANG_CPP11)
QSE::TcpServerL<int(QSE::Socket*,QSE::SocketAddress*)> server (
@ -79,7 +81,7 @@ static int test1 (void)
);
#else
QSE::TcpServerF<ClientHandler> server;
QSE::TcpServerF<ClientHandler> server (&heap_mmgr);
#endif
server.setThreadStackSize (256000);

View File

@ -2,6 +2,7 @@
#include <qse/si/mtx.h>
#include <qse/si/sio.h>
#include <qse/cmn/mem.h>
#include <qse/cmn/HeapMmgr.hpp>
#include <locale.h>
#if defined(_WIN32)
@ -15,6 +16,8 @@
static int g_stopreq = 0;
static qse_mtx_t* g_prmtx = QSE_NULL;
QSE::HeapMmgr g_heap_mmgr (QSE::Mmgr::getDFL(), 30000);
class MyThread: public QSE::Thread
{
public:
@ -126,7 +129,7 @@ static int test1 (void)
return -1;
}
QSE::ThreadR thr2;
QSE::ThreadR thr2 (&g_heap_mmgr);
thr2.setStackSize (64000);
thr2.setContext (&localstopreq);
#if defined(QSE_LANG_CPP11)