Winlin
23d2602c34
UniquePtr: Support SrsUniquePtr to replace SrsAutoFree. v6.0.136 ( #4109 )
...
To manage an object:
```cpp
// Before
MyClass* ptr = new MyClass();
SrsAutoFree(MyClass, ptr);
ptr->do_something();
// Now
SrsUniquePtr<MyClass> ptr(new MyClass());
ptr->do_something();
```
To manage an array of objects:
```cpp
// Before
char* ptr = new char[10];
SrsAutoFreeA(char, ptr);
ptr[0] = 0xf;
// Now
SrsUniquePtr<char[]> ptr(new char[10]);
ptr[0] = 0xf;
```
In fact, SrsUniquePtr is a limited subset of SrsAutoFree, mainly
managing pointers and arrays. SrsUniquePtr is better than SrsAutoFree
because it has the same API to standard unique ptr.
```cpp
SrsUniquePtr<MyClass> ptr(new MyClass());
ptr->do_something();
MyClass* p = ptr.get();
```
SrsAutoFree actually uses a pointer to a pointer, so it can be set to
NULL, allowing the pointer's value to be changed later (this usage is
different from SrsUniquePtr).
```cpp
// OK to free ptr correctly.
MyClass* ptr;
SrsAutoFree(MyClass, ptr);
ptr = new MyClass();
// Crash because ptr is an invalid pointer.
MyClass* ptr;
SrsUniquePtr<MyClass> ptr(ptr);
ptr = new MyClass();
```
Additionally, SrsAutoFreeH can use specific release functions, which
SrsUniquePtr does not support.
---------
Co-authored-by: Jacob Su <suzp1984@gmail.com>
2024-07-09 10:29:36 +08:00
Winlin
7ab012c60f
SmartPtr: Support detect memory leak by valgrind. v6.0.132 ( #4102 )
...
1. Support detect memory leak by valgrind.
2. Free the http handler entry.
3. Free the stack of ST.
---
Co-authored-by: Jacob Su <suzp1984@gmail.com>
2024-06-29 11:16:32 +08:00
winlin
2a2da2253f
Switch to 2013-2024. v6.0.109
2024-01-01 10:51:24 +08:00
winlin
c46ef81ff2
SRS5: Update license date to 2023. v5.0.123
...
PICK 72f8ed4916
2023-01-01 08:56:20 +08:00
chengh
6fa17aa3f8
ST: Support st_destroy to free resources for asan.
2022-11-21 22:26:46 +08:00
winlin
5a1a234855
ST: Refine tools and CMakeLists.txt. Add backtrace example. v5.0.79
2022-10-21 22:42:58 +08:00
winlin
dc20d5ddbc
ST: Support set context id while thread running. v5.0.72
2022-10-02 10:05:01 +08:00
winlin
297a104fef
Update state-threads to v1.9.4.
2022-09-06 09:22:32 +08:00
winlin
eb2056db25
ST: Define and use a new jmpbuf. v5.0.57
2022-09-01 11:51:04 +08:00
winlin
e9d6601f7d
For #2136 : API: Cleanup no active streams for statistics. v5.0.42
2022-08-19 19:45:19 +08:00
ChenGH
f2fa289fe8
AppleM1: Support Apple Silicon M1(aarch64).
2022-08-14 22:46:52 +08:00
winlin
1589858cb0
Support MIPS 64bits for loongson 3A4000/3B3000. v5.0.34
2022-08-06 13:03:45 +08:00
winlin
f7280399d4
Merge 4.0release, migrate to new website.
2022-07-31 18:34:18 +08:00
Steven Liu
08c4b25030
RISCV: Patch ST and libsrtp. #3115
2022-07-20 21:53:39 +08:00
winlin
339d3b31cc
ST: Support thread-local for multiple threads.
...
1. All statick and global variables is thread-local.
2. Call st_init() to init st for each thread.
3. Notice that ST is isolate for threads.
2022-06-28 20:49:53 +08:00
winlin
4110fb14cb
Squash: Fix bugs. v5.0.20
2022-01-11 08:40:37 +08:00
winlin
56a9e4d140
Change images from gitee to ossrs.net
2021-12-30 11:28:10 +08:00
winlin
5b44cc6a17
For #2689 , Support loongarch, loongson CPU. v5.0.19
2021-10-24 18:00:54 +08:00
winlin
596dd8c523
Support daemon(fork twice) for Darwin/OSX. v5.0.18
2021-10-17 16:53:39 +08:00
winlin
8ea9783de7
OpenWRT: Disable mprotect of ST. 5.0.16
2021-10-03 20:24:57 +08:00
winlin
1836847269
ST: Support Cygwin64 and MIPS
2021-10-02 08:54:53 +08:00
winlin
983d521987
API: Use libuuid to generate uuid. v5.0.9
2021-08-06 22:02:46 +08:00
winlin
6ddef894d9
ST: Refine OSX asm.
2021-07-29 08:46:38 +08:00
winlin
442cf615c0
ST: Simplify it, only Linux/Darwin, epoll/kqueue, single process. 5.0.2
...
commit f4872e528cad07f8ea683cc8cb26e34111bad1b5
Author: winlin <winlin@vip.126.com>
Date: Fri Feb 26 09:13:21 2021 +0800
ST: For #2188 : Remove sendmmsg from ST.
commit aaeb8919bd4a026268e0600398cb1e9ad477663f
Author: winlin <winlin@vip.126.com>
Date: Thu Mar 11 08:09:54 2021 +0800
ST: Refine utest script.
commit d1ac9da53060b6bfa82b5d041da4c2ad9bd6b90a
Author: winlin <winlin@vip.126.com>
Date: Wed Mar 3 11:02:25 2021 +0800
ST: Support fast utest and coverage
commit 8400115b83c022e33f59422dbf6d85ee46fb9edb
Author: winlin <winlin@vip.126.com>
Date: Fri Feb 26 07:02:19 2021 +0800
ST: Always use unserialized accept for linux or darwin
commit c3686f2bca80d2c139239b08975575b1bb981ffa
Author: winlin <winlin@vip.126.com>
Date: Fri Feb 26 06:54:05 2021 +0800
ST: Refine ARFLAGS by disable the verbose log
commit aaa5c4f863eba278c4ed2b29a46297fb01a4ed63
Author: winlin <winlin@vip.126.com>
Date: Thu Feb 25 08:58:46 2021 +0800
ST: Stack always grows from top to down.
commit dddd466e5c2e418c6f4896cd8bf701130052b3d9
Author: winlin <winlin@vip.126.com>
Date: Thu Feb 25 08:51:31 2021 +0800
ST: Ignore process fork, for single process only
commit 7906cb5f6e78c916cb8b8d9522275bfc086bb6a3
Author: winlin <winlin@vip.126.com>
Date: Thu Feb 25 08:50:59 2021 +0800
ST: Fix build warnings
commit d94921b84a3b6cf88ace2c766cc2bfedb9c0602e
Author: winlin <winlin@vip.126.com>
Date: Thu Feb 25 07:27:45 2021 +0800
ST: Remove select and poll support, only epoll and kqueue
commit 76d202514615f78d1a8f2b15778f3dac5abf4abb
Author: winlin <winlin@vip.126.com>
Date: Thu Feb 25 07:10:47 2021 +0800
ST: Remove multiple OS support, except Linux and Darwin.
commit 13c4ba345c61170e86dde486a174378ca235f442
Author: winlin <winlin@vip.126.com>
Date: Thu Feb 25 06:59:35 2021 +0800
ST: Remove __ia64__ CPU support
commit 46c06e4a11879cfeb828382e44f11287782ce4b5
Author: winlin <winlin@vip.126.com>
Date: Wed Feb 24 11:37:27 2021 +0800
ST: Remove unused files for ST
2021-05-19 18:25:49 +08:00
winlin
1ee77614fb
Refine comments
2021-04-05 12:14:26 +08:00
winlin
bb37a5550c
Test: Update srs-bench
2021-03-23 12:12:01 +08:00
winlin
7d12c3641a
Merge ST, support utest and coverage by gtest.
2021-03-04 15:01:14 +08:00
winlin
cec588e08a
For #2188 : Remove sendmmsg from ST.
2021-03-02 19:31:33 +08:00
winlin
34dae0fe0d
For #2188 : Remove sendmmsg from ST.
2021-02-26 09:13:21 +08:00
winlin
0fe031a156
Support to disable stats by default
2021-02-19 18:53:34 +08:00
winlin
a049ce3fb7
For #2194 , Core: Refine yield for high performance timer.
2021-02-19 18:53:14 +08:00
winlin
b4b9776b02
Core: Support yield current coroutine for high performance timer.
2021-02-19 18:53:03 +08:00
winlin
d8563398b2
Clock: Update stat. Insert timer to execute first
2021-02-19 18:53:02 +08:00
winlin
9db7126eb4
Core: Refine ST stat for thread switch
2021-02-19 18:52:56 +08:00
winlin
15f7fa2c36
Core: Refine ST stat for io events
2021-02-19 18:52:54 +08:00
winlin
12d7e57011
Core: Refine sched and clock stat
2021-02-19 18:52:53 +08:00
winlin
70fb647ac9
Perf: Add stat for sched of ST.
2021-02-19 18:52:27 +08:00
winlin
e91e0eaf46
Perf: Add stat for io of ST.
2021-02-19 18:52:12 +08:00
winlin
25be6d6bc0
Support to disable stats by default
2021-02-15 13:09:13 +08:00
winlin
a04dd7ed30
For #2194 , Core: Refine yield for high performance timer.
2021-02-11 22:49:08 +08:00
winlin
79f9cd6b3a
Core: Support yield current coroutine for high performance timer.
2021-02-11 21:04:09 +08:00
winlin
321f555e30
Clock: Update stat. Insert timer to execute first
2021-02-11 17:34:03 +08:00
winlin
71cc8e35d9
Core: Refine ST stat for thread switch
2021-02-11 13:26:20 +08:00
winlin
e726aba8f9
Core: Refine ST stat for io events
2021-02-11 12:07:38 +08:00
winlin
cde456710d
Core: Refine sched and clock stat
2021-02-11 09:39:09 +08:00
winlin
a46debb4bb
Perf: Add stat for sched of ST.
2021-02-10 20:00:33 +08:00
winlin
7b913b1115
Perf: Add stat for io of ST.
2021-02-10 18:20:11 +08:00
winlin
6fa3b8212c
Update ST doc
2021-02-10 15:56:43 +08:00
winlin
9ada516e98
At least wait 1ms when <1ms, to avoid epoll_wait spin loop. 4.0.66
2021-02-10 15:55:01 +08:00
winlin
de3ec74657
Update ST doc
2021-02-05 10:20:23 +08:00