diff options
author | Henrik Gramner <gramner@twoorioles.com> | 2019-05-09 21:39:08 +0300 |
---|---|---|
committer | Henrik Gramner <henrik@gramner.com> | 2019-05-10 00:35:04 +0300 |
commit | 8d2dd439005f72e2f73fc6155f0c2245cbf3227f (patch) | |
tree | 53ccb8ad8bd2fb4839eaf1e9f0e06596e4b7ccb1 /src/win32 | |
parent | d400361524ce739db30d552a9e54809d812710c6 (diff) |
Add __attribute__((cold)) to rarely used functions
Diffstat (limited to 'src/win32')
-rw-r--r-- | src/win32/thread.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/win32/thread.c b/src/win32/thread.c index 2c2a578..c579ba4 100644 --- a/src/win32/thread.c +++ b/src/win32/thread.c @@ -33,17 +33,19 @@ #include <stdlib.h> #include <windows.h> +#include "common/attributes.h" + #include "src/thread.h" -static unsigned __stdcall thread_entrypoint(void *const data) { +static COLD unsigned __stdcall thread_entrypoint(void *const data) { pthread_t *const t = data; t->arg = t->func(t->arg); return 0; } -int dav1d_pthread_create(pthread_t *const thread, - const pthread_attr_t *const attr, - void *(*const func)(void*), void *const arg) +COLD int dav1d_pthread_create(pthread_t *const thread, + const pthread_attr_t *const attr, + void *(*const func)(void*), void *const arg) { const unsigned stack_size = attr ? attr->stack_size : 0; thread->func = func; @@ -53,7 +55,7 @@ int dav1d_pthread_create(pthread_t *const thread, return !thread->h; } -int dav1d_pthread_join(pthread_t *const thread, void **const res) { +COLD int dav1d_pthread_join(pthread_t *const thread, void **const res) { if (WaitForSingleObject(thread->h, INFINITE)) return 1; @@ -63,8 +65,8 @@ int dav1d_pthread_join(pthread_t *const thread, void **const res) { return !CloseHandle(thread->h); } -int dav1d_pthread_once(pthread_once_t *const once_control, - void (*const init_routine)(void)) +COLD int dav1d_pthread_once(pthread_once_t *const once_control, + void (*const init_routine)(void)) { BOOL pending = FALSE; |