diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 20 | ||||
| -rw-r--r-- | src/callproc.c | 2 | ||||
| -rw-r--r-- | src/dispnew.c | 10 | ||||
| -rw-r--r-- | src/emacs.c | 30 | ||||
| -rw-r--r-- | src/lisp.h | 4 |
5 files changed, 40 insertions, 26 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index fabbcbef40d..767dfa47036 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,5 +1,25 @@ | |||
| 1 | 2012-05-30 Paul Eggert <eggert@cs.ucla.edu> | 1 | 2012-05-30 Paul Eggert <eggert@cs.ucla.edu> |
| 2 | 2 | ||
| 3 | Clean up __executable_start, monstartup when --enable-profiling. | ||
| 4 | The following changes affect the code only when profiling. | ||
| 5 | * dispnew.c (__executable_start): Rename from safe_bcopy. | ||
| 6 | Define only on platforms that need it. | ||
| 7 | * emacs.c: Include <sys/gmon.h> when profiling. | ||
| 8 | (_mcleanup): Remove decl, since <sys/gmon.h> does it now. | ||
| 9 | (__executable_start): Remove decl, since lisp.h does it now. | ||
| 10 | (safe_bcopy): Remove decl; no longer has that name. | ||
| 11 | (main): Coalesce #if into single bit of code, for simplicity. | ||
| 12 | Cast pointers to uintptr_t, since standard libraries want integers | ||
| 13 | and not pointers. | ||
| 14 | * lisp.h (__executable_start): New decl. | ||
| 15 | |||
| 16 | 2012-05-30 Jim Meyering <meyering@redhat.com> | ||
| 17 | |||
| 18 | * callproc.c (Fcall_process_region): Include directory component | ||
| 19 | in mkstemp error message (Bug#11586). | ||
| 20 | |||
| 21 | 2012-05-30 Paul Eggert <eggert@cs.ucla.edu> | ||
| 22 | |||
| 3 | * alloc.c, lisp.h (make_pure_vector): Now static. | 23 | * alloc.c, lisp.h (make_pure_vector): Now static. |
| 4 | 24 | ||
| 5 | 2012-05-30 Stefan Monnier <monnier@iro.umontreal.ca> | 25 | 2012-05-30 Stefan Monnier <monnier@iro.umontreal.ca> |
diff --git a/src/callproc.c b/src/callproc.c index f7c9971907d..976d3061c8b 100644 --- a/src/callproc.c +++ b/src/callproc.c | |||
| @@ -1015,7 +1015,7 @@ usage: (call-process-region START END PROGRAM &optional DELETE BUFFER DISPLAY &r | |||
| 1015 | UNBLOCK_INPUT; | 1015 | UNBLOCK_INPUT; |
| 1016 | if (fd == -1) | 1016 | if (fd == -1) |
| 1017 | report_file_error ("Failed to open temporary file", | 1017 | report_file_error ("Failed to open temporary file", |
| 1018 | Fcons (Vtemp_file_name_pattern, Qnil)); | 1018 | Fcons (build_string (tempfile), Qnil)); |
| 1019 | else | 1019 | else |
| 1020 | close (fd); | 1020 | close (fd); |
| 1021 | } | 1021 | } |
diff --git a/src/dispnew.c b/src/dispnew.c index 35ccd95e92a..b8ce90bff9f 100644 --- a/src/dispnew.c +++ b/src/dispnew.c | |||
| @@ -336,11 +336,13 @@ DEFUN ("dump-redisplay-history", Fdump_redisplay_history, | |||
| 336 | #endif /* GLYPH_DEBUG == 0 */ | 336 | #endif /* GLYPH_DEBUG == 0 */ |
| 337 | 337 | ||
| 338 | 338 | ||
| 339 | #if defined PROFILING && !HAVE___EXECUTABLE_START | 339 | #if (defined PROFILING \ |
| 340 | /* FIXME: only used to find text start for profiling. */ | 340 | && (defined __FreeBSD__ || defined GNU_LINUX || defined __MINGW32__) \ |
| 341 | 341 | && !HAVE___EXECUTABLE_START) | |
| 342 | /* This function comes first in the Emacs executable and is used only | ||
| 343 | to estimate the text start for profiling. */ | ||
| 342 | void | 344 | void |
| 343 | safe_bcopy (const char *from, char *to, int size) | 345 | __executable_start (void) |
| 344 | { | 346 | { |
| 345 | abort (); | 347 | abort (); |
| 346 | } | 348 | } |
diff --git a/src/emacs.c b/src/emacs.c index a942878fe00..3477d92dc6f 100644 --- a/src/emacs.c +++ b/src/emacs.c | |||
| @@ -68,6 +68,12 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 68 | #include "nsterm.h" | 68 | #include "nsterm.h" |
| 69 | #endif | 69 | #endif |
| 70 | 70 | ||
| 71 | #if (defined PROFILING \ | ||
| 72 | && (defined __FreeBSD__ || defined GNU_LINUX || defined __MINGW32__)) | ||
| 73 | # include <sys/gmon.h> | ||
| 74 | extern void moncontrol (int mode); | ||
| 75 | #endif | ||
| 76 | |||
| 71 | #ifdef HAVE_X_WINDOWS | 77 | #ifdef HAVE_X_WINDOWS |
| 72 | #include "xterm.h" | 78 | #include "xterm.h" |
| 73 | #endif | 79 | #endif |
| @@ -323,9 +329,9 @@ pthread_t main_thread; | |||
| 323 | #ifdef HAVE_NS | 329 | #ifdef HAVE_NS |
| 324 | /* NS autrelease pool, for memory management. */ | 330 | /* NS autrelease pool, for memory management. */ |
| 325 | static void *ns_pool; | 331 | static void *ns_pool; |
| 326 | #endif | 332 | #endif |
| 333 | |||
| 327 | 334 | ||
| 328 | |||
| 329 | 335 | ||
| 330 | /* Handle bus errors, invalid instruction, etc. */ | 336 | /* Handle bus errors, invalid instruction, etc. */ |
| 331 | #ifndef FLOAT_CATCH_SIGILL | 337 | #ifndef FLOAT_CATCH_SIGILL |
| @@ -1670,32 +1676,14 @@ Using an Emacs configured with --with-x-toolkit=lucid does not have this problem | |||
| 1670 | #ifdef PROFILING | 1676 | #ifdef PROFILING |
| 1671 | if (initialized) | 1677 | if (initialized) |
| 1672 | { | 1678 | { |
| 1673 | extern void _mcleanup (); | ||
| 1674 | #ifdef __MINGW32__ | 1679 | #ifdef __MINGW32__ |
| 1675 | extern unsigned char etext asm ("etext"); | 1680 | extern unsigned char etext asm ("etext"); |
| 1676 | #else | 1681 | #else |
| 1677 | extern char etext; | 1682 | extern char etext; |
| 1678 | #endif | 1683 | #endif |
| 1679 | #ifdef HAVE___EXECUTABLE_START | ||
| 1680 | /* This symbol is defined by GNU ld to the start of the text | ||
| 1681 | segment. */ | ||
| 1682 | extern char __executable_start[]; | ||
| 1683 | #else | ||
| 1684 | extern void safe_bcopy (); | ||
| 1685 | #endif | ||
| 1686 | 1684 | ||
| 1687 | atexit (_mcleanup); | 1685 | atexit (_mcleanup); |
| 1688 | #ifdef HAVE___EXECUTABLE_START | 1686 | monstartup ((uintptr_t) __executable_start, (uintptr_t) &etext); |
| 1689 | monstartup (__executable_start, &etext); | ||
| 1690 | #else | ||
| 1691 | /* This uses safe_bcopy because that function comes first in the | ||
| 1692 | Emacs executable. It might be better to use something that | ||
| 1693 | gives the start of the text segment, but start_of_text is not | ||
| 1694 | defined on all systems now. */ | ||
| 1695 | /* FIXME: Does not work on architectures with function | ||
| 1696 | descriptors. */ | ||
| 1697 | monstartup (safe_bcopy, &etext); | ||
| 1698 | #endif | ||
| 1699 | } | 1687 | } |
| 1700 | else | 1688 | else |
| 1701 | moncontrol (0); | 1689 | moncontrol (0); |
diff --git a/src/lisp.h b/src/lisp.h index 1bdd10bb9d1..5e64392ec78 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -2762,6 +2762,10 @@ extern void replace_range_2 (ptrdiff_t, ptrdiff_t, ptrdiff_t, ptrdiff_t, | |||
| 2762 | extern void syms_of_insdel (void); | 2762 | extern void syms_of_insdel (void); |
| 2763 | 2763 | ||
| 2764 | /* Defined in dispnew.c */ | 2764 | /* Defined in dispnew.c */ |
| 2765 | #if (defined PROFILING \ | ||
| 2766 | && (defined __FreeBSD__ || defined GNU_LINUX || defined __MINGW32__)) | ||
| 2767 | void __executable_start (void) NO_RETURN; | ||
| 2768 | #endif | ||
| 2765 | extern Lisp_Object selected_frame; | 2769 | extern Lisp_Object selected_frame; |
| 2766 | extern Lisp_Object Vwindow_system; | 2770 | extern Lisp_Object Vwindow_system; |
| 2767 | EXFUN (Fding, 1); | 2771 | EXFUN (Fding, 1); |