-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(c): modify defineDirectDeclarator rule in C.g4
Modify the `defineDirectDeclarator` rule in `C.g4` to only allow a single expression instead of a comma-separated list. This change simplifies the rule and improves readability. feat(chapi-ast-c): add timing information to CFullIdentListenerTest Add timing information to the `CFullIdentListenerTest` class in order to measure the execution time of the analysis process. This helps to identify slow macro processing and optimize performance. feat(chapi-ast-c): add SlowMacro.c test resource Add a new test resource file, `SlowMacro.c`, which contains Windows-specific code for handling thread attachment and detachment. This file also includes macros for handling TLS (Thread Local Storage) and includes timing information for performance analysis.
- Loading branch information
Showing
3 changed files
with
41 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#ifdef _WIN32 | ||
static BOOL WINAPI | ||
_tls_callback(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) { | ||
switch (fdwReason) { | ||
#ifdef JEMALLOC_LAZY_LOCK | ||
case DLL_THREAD_ATTACH: | ||
isthreaded = true; | ||
break; | ||
#endif | ||
case DLL_THREAD_DETACH: | ||
_malloc_thread_cleanup(); | ||
break; | ||
default: | ||
break; | ||
} | ||
return true; | ||
} | ||
|
||
#ifdef read | ||
# undef read | ||
#endif | ||
|
||
#ifdef _MSC_VER | ||
# ifdef _M_IX86 | ||
# pragma comment(linker, "/INCLUDE:__tls_used") | ||
# pragma comment(linker, "/INCLUDE:_tls_callback") | ||
# else | ||
# pragma comment(linker, "/INCLUDE:_tls_used") | ||
# pragma comment(linker, "/INCLUDE:" STRINGIFY(tls_callback) ) | ||
# endif | ||
# pragma section(".CRT$XLY",long,read) | ||
#endif | ||
JEMALLOC_SECTION(".CRT$XLY") JEMALLOC_ATTR(used) | ||
BOOL (WINAPI *const tls_callback)(HINSTANCE hinstDLL, | ||
DWORD fdwReason, LPVOID lpvReserved) = _tls_callback; | ||
#endif |