From e610ea430586cd5e966cb0907a2bb2e3880ba4ff Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Mon, 11 Aug 1997 01:38:02 +0000 Subject: [PATCH] (main) [__FreeBSD__ && PROFILING]: Add code for profiling. --- src/emacs.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/emacs.c b/src/emacs.c index 7e6ac1413f..05b044f57c 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -1095,6 +1095,24 @@ the Bugs section of the Emacs manual or the file BUGS.\n", argv[0]); #endif } + /* Gerd Moellmann says this makes profiling work on + FreeBSD. It might work on some other systems too. + Give it a try and tell me if it works on your system. */ +#ifdef __FreeBSD__ +#ifdef PROFILING + if (initialized) + { + extern void _mcleanup (); + extern char etext; + extern void clear_glyph_matrix (); + atexit (_mcleanup); + monstartup (clear_glyph_matrix, &etext); + } + else + moncontrol (0); +#endif +#endif + initialized = 1; #ifdef LOCALTIME_CACHE -- 2.39.2