2024-09-10 16:41:34 +08:00
|
|
|
{
|
|
|
|
|
"cmake.sourceDirectory": "${workspaceFolder}/trunk/ide/srs_clion",
|
|
|
|
|
"cmake.buildDirectory": "${workspaceFolder}/trunk/ide/vscode-build",
|
Support custom deleter for SrsUniquePtr. (#4309)
SrsUniquePtr does not support array or object created by malloc, because
we only use delete to dispose the resource. You can use a custom
function to free the memory allocated by malloc or other allocators.
```cpp
char* p = (char*)malloc(1024);
SrsUniquePtr<char> ptr(p, your_free_chars);
```
This is used to replace the SrsAutoFreeH. For example:
```cpp
addrinfo* r = NULL;
SrsAutoFreeH(addrinfo, r, freeaddrinfo);
getaddrinfo("127.0.0.1", NULL, &hints, &r);
```
Now, this can be replaced by:
```cpp
addrinfo* r = NULL;
getaddrinfo("127.0.0.1", NULL, &hints, &r);
SrsUniquePtr<addrinfo> r2(r, freeaddrinfo);
```
Please aware that there is a slight difference between SrsAutoFreeH and
SrsUniquePtr. SrsAutoFreeH will track the address of pointer, while
SrsUniquePtr will not.
```cpp
addrinfo* r = NULL;
SrsAutoFreeH(addrinfo, r, freeaddrinfo); // r will be freed even r is changed later.
SrsUniquePtr<addrinfo> ptr(r, freeaddrinfo); // crash because r is an invalid pointer.
```
---------
Co-authored-by: Haibo Chen <495810242@qq.com>
Co-authored-by: john <hondaxiao@tencent.com>
2025-04-26 00:01:34 -04:00
|
|
|
"cmake.configureOnOpen": false,
|
2025-05-28 18:38:56 -04:00
|
|
|
"cmake.ctest.testExplorerIntegrationEnabled": false,
|
|
|
|
|
"testMate.cpp.test.advancedExecutables": [
|
|
|
|
|
"{build,Build,BUILD,out,Out,OUT}/**/*{test,Test,TEST}*",
|
|
|
|
|
"${workspaceFolder}/trunk/ide/vscode-build/**/*{utest,test,Test,TEST}*"
|
|
|
|
|
],
|
Support custom deleter for SrsUniquePtr. (#4309)
SrsUniquePtr does not support array or object created by malloc, because
we only use delete to dispose the resource. You can use a custom
function to free the memory allocated by malloc or other allocators.
```cpp
char* p = (char*)malloc(1024);
SrsUniquePtr<char> ptr(p, your_free_chars);
```
This is used to replace the SrsAutoFreeH. For example:
```cpp
addrinfo* r = NULL;
SrsAutoFreeH(addrinfo, r, freeaddrinfo);
getaddrinfo("127.0.0.1", NULL, &hints, &r);
```
Now, this can be replaced by:
```cpp
addrinfo* r = NULL;
getaddrinfo("127.0.0.1", NULL, &hints, &r);
SrsUniquePtr<addrinfo> r2(r, freeaddrinfo);
```
Please aware that there is a slight difference between SrsAutoFreeH and
SrsUniquePtr. SrsAutoFreeH will track the address of pointer, while
SrsUniquePtr will not.
```cpp
addrinfo* r = NULL;
SrsAutoFreeH(addrinfo, r, freeaddrinfo); // r will be freed even r is changed later.
SrsUniquePtr<addrinfo> ptr(r, freeaddrinfo); // crash because r is an invalid pointer.
```
---------
Co-authored-by: Haibo Chen <495810242@qq.com>
Co-authored-by: john <hondaxiao@tencent.com>
2025-04-26 00:01:34 -04:00
|
|
|
"files.associations": {
|
|
|
|
|
"vector": "cpp",
|
|
|
|
|
"__hash_table": "cpp",
|
|
|
|
|
"__split_buffer": "cpp",
|
|
|
|
|
"__tree": "cpp",
|
|
|
|
|
"array": "cpp",
|
|
|
|
|
"bitset": "cpp",
|
|
|
|
|
"deque": "cpp",
|
|
|
|
|
"initializer_list": "cpp",
|
|
|
|
|
"list": "cpp",
|
|
|
|
|
"map": "cpp",
|
|
|
|
|
"queue": "cpp",
|
|
|
|
|
"set": "cpp",
|
|
|
|
|
"stack": "cpp",
|
|
|
|
|
"string": "cpp",
|
|
|
|
|
"string_view": "cpp",
|
2025-06-30 08:10:21 -04:00
|
|
|
"unordered_map": "cpp",
|
|
|
|
|
"__bit_reference": "cpp",
|
|
|
|
|
"__locale": "cpp",
|
|
|
|
|
"__node_handle": "cpp",
|
|
|
|
|
"__verbose_abort": "cpp",
|
|
|
|
|
"any": "cpp",
|
|
|
|
|
"cctype": "cpp",
|
|
|
|
|
"charconv": "cpp",
|
|
|
|
|
"clocale": "cpp",
|
|
|
|
|
"cmath": "cpp",
|
|
|
|
|
"complex": "cpp",
|
|
|
|
|
"condition_variable": "cpp",
|
|
|
|
|
"csignal": "cpp",
|
|
|
|
|
"cstdarg": "cpp",
|
|
|
|
|
"cstdint": "cpp",
|
|
|
|
|
"cstdio": "cpp",
|
|
|
|
|
"cstdlib": "cpp",
|
|
|
|
|
"cstring": "cpp",
|
|
|
|
|
"ctime": "cpp",
|
|
|
|
|
"cwchar": "cpp",
|
|
|
|
|
"cwctype": "cpp",
|
|
|
|
|
"execution": "cpp",
|
|
|
|
|
"memory": "cpp",
|
|
|
|
|
"forward_list": "cpp",
|
|
|
|
|
"fstream": "cpp",
|
|
|
|
|
"iomanip": "cpp",
|
|
|
|
|
"ios": "cpp",
|
|
|
|
|
"iosfwd": "cpp",
|
|
|
|
|
"iostream": "cpp",
|
|
|
|
|
"istream": "cpp",
|
|
|
|
|
"limits": "cpp",
|
|
|
|
|
"locale": "cpp",
|
|
|
|
|
"mutex": "cpp",
|
|
|
|
|
"new": "cpp",
|
|
|
|
|
"optional": "cpp",
|
|
|
|
|
"print": "cpp",
|
|
|
|
|
"ratio": "cpp",
|
|
|
|
|
"sstream": "cpp",
|
|
|
|
|
"stdexcept": "cpp",
|
|
|
|
|
"streambuf": "cpp",
|
|
|
|
|
"typeinfo": "cpp",
|
|
|
|
|
"variant": "cpp",
|
|
|
|
|
"algorithm": "cpp"
|
Support custom deleter for SrsUniquePtr. (#4309)
SrsUniquePtr does not support array or object created by malloc, because
we only use delete to dispose the resource. You can use a custom
function to free the memory allocated by malloc or other allocators.
```cpp
char* p = (char*)malloc(1024);
SrsUniquePtr<char> ptr(p, your_free_chars);
```
This is used to replace the SrsAutoFreeH. For example:
```cpp
addrinfo* r = NULL;
SrsAutoFreeH(addrinfo, r, freeaddrinfo);
getaddrinfo("127.0.0.1", NULL, &hints, &r);
```
Now, this can be replaced by:
```cpp
addrinfo* r = NULL;
getaddrinfo("127.0.0.1", NULL, &hints, &r);
SrsUniquePtr<addrinfo> r2(r, freeaddrinfo);
```
Please aware that there is a slight difference between SrsAutoFreeH and
SrsUniquePtr. SrsAutoFreeH will track the address of pointer, while
SrsUniquePtr will not.
```cpp
addrinfo* r = NULL;
SrsAutoFreeH(addrinfo, r, freeaddrinfo); // r will be freed even r is changed later.
SrsUniquePtr<addrinfo> ptr(r, freeaddrinfo); // crash because r is an invalid pointer.
```
---------
Co-authored-by: Haibo Chen <495810242@qq.com>
Co-authored-by: john <hondaxiao@tencent.com>
2025-04-26 00:01:34 -04:00
|
|
|
}
|
2024-09-10 16:41:34 +08:00
|
|
|
}
|