| 903 | } |
| 904 | |
| 905 | void gjs_profiler_set_fd(GjsProfiler* self, int fd) { |
| 906 | g_return_if_fail(self); |
| 907 | g_return_if_fail(!self->filename); |
| 908 | g_return_if_fail(!self->running); |
| 909 | |
| 910 | #ifdef ENABLE_PROFILER |
| 911 | if (self->fd != fd) { |
| 912 | if (self->fd != -1) |
| 913 | close(self->fd); |
| 914 | self->fd = fd; |
| 915 | } |
| 916 | #else |
| 917 | (void)fd; // Unused in the no-profiler case |
| 918 | #endif |
| 919 | } |
| 920 | |
| 921 | void gjs_profiler_set_finalize_status(GjsProfiler* self, |
| 922 | JSFinalizeStatus status) { |