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
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
eb2056db25
ST: Define and use a new jmpbuf. v5.0.57
2022-09-01 11:51:04 +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
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
1836847269
ST: Support Cygwin64 and MIPS
2021-10-02 08:54:53 +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
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
a049ce3fb7
For #2194 , Core: Refine yield for high performance timer.
2021-02-19 18:53:14 +08:00
winlin
a04dd7ed30
For #2194 , Core: Refine yield for high performance timer.
2021-02-11 22:49:08 +08:00
winlin
6fa3b8212c
Update ST doc
2021-02-10 15:56:43 +08:00
winlin
de3ec74657
Update ST doc
2021-02-05 10:20:23 +08:00
winlin
cd83054759
ST: Update doc
2021-01-31 18:07:36 +08:00
winlin
09224ea7e0
ST: Update doc
2021-01-31 18:07:31 +08:00
winlin
5678e8e1e7
ST: Update doc
2021-01-26 09:03:39 +08:00
winlin
6ecda1c79e
ST: Update doc
2021-01-26 08:58:22 +08:00
winlin
bff93c3f6a
Update ST doc
2020-04-21 13:30:00 +08:00
winlin
a579f51e72
Remove ST in research
2020-04-19 20:51:39 +08:00
winlin
ce36a970ff
Refine perf stat
2020-04-18 22:55:38 +08:00
winlin
84f6f3d051
For #1537 , #1282 , support aarch64 for armv8. 3.0.84
2019-12-25 19:58:15 +08:00
winlin
97bb8a5405
For #1537 , #1282 , support disable ASM to avoid building bug.
2019-12-25 16:22:00 +08:00
winlin
b672ad4b1f
For #1537 , #1282 , sync with state-threads/srs
2019-12-25 16:09:25 +08:00
winlin
916ec71801
For #1537 , #1282 , use ST source code in SRS
2019-12-25 15:55:56 +08:00