Optimize memory allocation for client buffer; add VLD to detect memory on Windows.
This commit is contained in:
@@ -40,7 +40,7 @@ void Test(boost::asio::io_context& ioc) {
|
||||
}
|
||||
|
||||
int main() {
|
||||
LOG_INIT("", webcc::LOG_CONSOLE);
|
||||
WEBCC_LOG_INIT("", webcc::LOG_CONSOLE);
|
||||
|
||||
boost::asio::io_context ioc;
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ void Test() {
|
||||
}
|
||||
|
||||
int main() {
|
||||
LOG_INIT("", webcc::LOG_CONSOLE);
|
||||
WEBCC_LOG_INIT("", webcc::LOG_CONSOLE);
|
||||
|
||||
Test();
|
||||
Test();
|
||||
|
||||
@@ -101,7 +101,7 @@ int main(int argc, char* argv[]) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
LOG_INIT("", webcc::LOG_CONSOLE);
|
||||
WEBCC_LOG_INIT("", webcc::LOG_CONSOLE);
|
||||
|
||||
std::string host = argv[1];
|
||||
std::string port = argv[2];
|
||||
|
||||
@@ -5,6 +5,19 @@
|
||||
#include "webcc/logger.h"
|
||||
#include "webcc/rest_client.h"
|
||||
|
||||
// In order to run with VLD, please copy the following files to the example
|
||||
// output folder from "third_party\win32\bin":
|
||||
// - dbghelp.dll
|
||||
// - Microsoft.DTfW.DHL.manifest
|
||||
// - vld_x86.dll
|
||||
#if (defined(WIN32) || defined(_WIN64))
|
||||
#if defined(_DEBUG) && defined(WEBCC_ENABLE_VLD)
|
||||
#pragma message ("< include vld.h >")
|
||||
#include "vld/vld.h"
|
||||
#pragma comment(lib, "vld")
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
// Write a JSON object to string.
|
||||
@@ -160,7 +173,7 @@ int main(int argc, char* argv[]) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
LOG_INIT("", webcc::LOG_CONSOLE);
|
||||
WEBCC_LOG_INIT("", webcc::LOG_CONSOLE);
|
||||
|
||||
std::string host = argv[1];
|
||||
std::string port = argv[2];
|
||||
|
||||
@@ -5,6 +5,19 @@
|
||||
|
||||
#include "book_services.h"
|
||||
|
||||
// In order to run with VLD, please copy the following files to the example
|
||||
// output folder from "third_party\win32\bin":
|
||||
// - dbghelp.dll
|
||||
// - Microsoft.DTfW.DHL.manifest
|
||||
// - vld_x86.dll
|
||||
#if (defined(WIN32) || defined(_WIN64))
|
||||
#if defined(_DEBUG) && defined(WEBCC_ENABLE_VLD)
|
||||
#pragma message ("< include vld.h >")
|
||||
#include "vld/vld.h"
|
||||
#pragma comment(lib, "vld")
|
||||
#endif
|
||||
#endif
|
||||
|
||||
void Help(const char* argv0) {
|
||||
std::cout << "Usage: " << argv0 << " <port> [seconds]" << std::endl;
|
||||
std::cout << "If |seconds| is provided, the server will sleep these seconds "
|
||||
@@ -21,7 +34,7 @@ int main(int argc, char* argv[]) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
LOG_INIT("", webcc::LOG_FILE | webcc::LOG_CONSOLE | webcc::LOG_OVERWRITE);
|
||||
WEBCC_LOG_INIT("", webcc::LOG_CONSOLE);
|
||||
|
||||
unsigned short port = std::atoi(argv[1]);
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#include "calc_client.h"
|
||||
|
||||
int main() {
|
||||
LOG_INIT("", webcc::LOG_CONSOLE);
|
||||
WEBCC_LOG_INIT("", webcc::LOG_CONSOLE);
|
||||
|
||||
CalcClient calc;
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ int main(int argc, char* argv[]) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
LOG_INIT("", webcc::LOG_CONSOLE);
|
||||
WEBCC_LOG_INIT("", webcc::LOG_CONSOLE);
|
||||
|
||||
unsigned short port = std::atoi(argv[1]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user