From 8db25a0bf5f8320e2251595eb628055706230d3a Mon Sep 17 00:00:00 2001 From: winlin Date: Thu, 21 Jan 2016 16:18:42 +0800 Subject: [PATCH] fix the log for mmap. --- trunk/src/app/srs_app_server.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/trunk/src/app/srs_app_server.cpp b/trunk/src/app/srs_app_server.cpp index 2dde7fa48..751b19120 100644 --- a/trunk/src/app/srs_app_server.cpp +++ b/trunk/src/app/srs_app_server.cpp @@ -642,11 +642,12 @@ int SrsServer::initialize_st() // @remark, st alloc segment use mmap, which only support 32757 threads, // if need to support more, for instance, 100k threads, define the macro MALLOC_STACK. // TODO: FIXME: maybe can use "sysctl vm.max_map_count" to refine. - if (_srs_config->get_max_connections() > 32756) { + #define __MMAP_MAX_CONNECTIONS 32756 + if (_srs_config->get_max_connections() > __MMAP_MAX_CONNECTIONS) { ret = ERROR_ST_EXCEED_THREADS; srs_error("st mmap for stack allocation must <= %d threads, " "@see Makefile of st for MALLOC_STACK, please build st manually by " - "\"make EXTRA_CFLAGS=-DMALLOC_STACK linux-debug\", ret=%d", ret); + "\"make EXTRA_CFLAGS=-DMALLOC_STACK linux-debug\", ret=%d", __MMAP_MAX_CONNECTIONS, ret); return ret; }