mirror of
https://github.com/ossrs/srs.git
synced 2025-02-12 11:21:52 +00:00
Fix #509, Always malloc stack on heap. 3.0.153
This commit is contained in:
parent
86f8cbb5eb
commit
9a963c6fd2
5 changed files with 5 additions and 13 deletions
|
@ -145,6 +145,7 @@ For previous versions, please read:
|
|||
|
||||
## V3 changes
|
||||
|
||||
* v3.0, 2020-10-31, Fix [#509][bug #509], Always malloc stack on heap. 3.0.153
|
||||
* v3.0, 2020-10-31, Remove some global elements for debugging. 3.0.152
|
||||
* v3.0, 2020-10-31, Use global _srs_server for debugging. 3.0.151
|
||||
* v3.0, 2020-10-31, Refine source cid, track previous one. 3.0.150
|
||||
|
|
1
trunk/.gitignore
vendored
1
trunk/.gitignore
vendored
|
@ -41,3 +41,4 @@ srs
|
|||
*.h264
|
||||
*.264
|
||||
3rdparty/ffmpeg-4.2-fit
|
||||
bug
|
||||
|
|
|
@ -316,6 +316,8 @@ if [ $SRS_EXPORT_LIBRTMP_PROJECT = NO ]; then
|
|||
if [[ $SRS_OSX == YES ]]; then
|
||||
_ST_MAKE=darwin-debug && _ST_EXTRA_CFLAGS="-DMD_HAVE_KQUEUE" && _ST_LD=${SRS_TOOL_CC} && _ST_OBJ="DARWIN_*"
|
||||
fi
|
||||
# Always alloc on heap, @see https://github.com/ossrs/srs/issues/509#issuecomment-719931676
|
||||
_ST_EXTRA_CFLAGS="$_ST_EXTRA_CFLAGS -DMALLOC_STACK"
|
||||
# Pass the global extra flags.
|
||||
if [[ $SRS_EXTRA_FLAGS != '' ]]; then
|
||||
_ST_EXTRA_CFLAGS="$_ST_EXTRA_CFLAGS $SRS_EXTRA_FLAGS"
|
||||
|
|
|
@ -769,18 +769,6 @@ srs_error_t SrsServer::initialize_st()
|
|||
if ((err = srs_st_init()) != srs_success) {
|
||||
return srs_error_wrap(err, "initialize st failed");
|
||||
}
|
||||
|
||||
// @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.
|
||||
#define __MMAP_MAX_CONNECTIONS 32756
|
||||
if (_srs_config->get_max_connections() > __MMAP_MAX_CONNECTIONS) {
|
||||
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\"", __MMAP_MAX_CONNECTIONS);
|
||||
return srs_error_new(ERROR_ST_EXCEED_THREADS, "%d exceed max %d threads",
|
||||
_srs_config->get_max_connections(), __MMAP_MAX_CONNECTIONS);
|
||||
}
|
||||
|
||||
// set current log id.
|
||||
_srs_context->generate_id();
|
||||
|
|
|
@ -24,6 +24,6 @@
|
|||
#ifndef SRS_CORE_VERSION3_HPP
|
||||
#define SRS_CORE_VERSION3_HPP
|
||||
|
||||
#define SRS_VERSION3_REVISION 152
|
||||
#define SRS_VERSION3_REVISION 153
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue