diff options
| author | Juanma Barranquero | 2012-09-25 13:57:30 +0200 |
|---|---|---|
| committer | Juanma Barranquero | 2012-09-25 13:57:30 +0200 |
| commit | aa15c6bb4fec3c36efe1c05000e05faa6a483038 (patch) | |
| tree | ec142ef200c87cd6391e2a370a77ebbc4f2bd1ce | |
| parent | 16b22fef423afedf034460a0f811abf50d0c5f3e (diff) | |
| download | emacs-aa15c6bb4fec3c36efe1c05000e05faa6a483038.tar.gz emacs-aa15c6bb4fec3c36efe1c05000e05faa6a483038.zip | |
Move Vlibrary_cache to emacs.c and reset before dumping.
* src/lisp.h (reset_image_types): Declare.
[WINDOWSNT] (Vlibrary_cache): Declare.
* src/image.c (reset_image_types): New function.
* src/emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
(syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
(Fdump_emacs): Reset Vlibrary_cache and image_types.
* src/w32.c (Vlibrary_cache): Do not define; moved to emacs.c
(globals_of_w32) <Vlibrary_cache>: Do not initialize.
* src/w32.h (Vlibrary_cache): Do not declare.
| -rw-r--r-- | src/ChangeLog | 18 | ||||
| -rw-r--r-- | src/emacs.c | 17 | ||||
| -rw-r--r-- | src/image.c | 18 | ||||
| -rw-r--r-- | src/lisp.h | 4 | ||||
| -rw-r--r-- | src/w32.c | 7 | ||||
| -rw-r--r-- | src/w32.h | 2 |
6 files changed, 55 insertions, 11 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 9d048beeec1..1b0668860b9 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,21 @@ | |||
| 1 | 2012-09-25 Juanma Barranquero <lekktu@gmail.com> | ||
| 2 | |||
| 3 | Move Vlibrary_cache to emacs.c and reset before dumping. | ||
| 4 | |||
| 5 | * lisp.h (reset_image_types): Declare. | ||
| 6 | [WINDOWSNT] (Vlibrary_cache): Declare. | ||
| 7 | |||
| 8 | * image.c (reset_image_types): New function. | ||
| 9 | |||
| 10 | * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c. | ||
| 11 | (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro. | ||
| 12 | (Fdump_emacs): Reset Vlibrary_cache and image_types. | ||
| 13 | |||
| 14 | * w32.c (Vlibrary_cache): Do not define; moved to emacs.c | ||
| 15 | (globals_of_w32) <Vlibrary_cache>: Do not initialize. | ||
| 16 | |||
| 17 | * w32.h (Vlibrary_cache): Do not declare. | ||
| 18 | |||
| 1 | 2012-09-25 Eli Zaretskii <eliz@gnu.org> | 19 | 2012-09-25 Eli Zaretskii <eliz@gnu.org> |
| 2 | 20 | ||
| 3 | * w32proc.c (sys_signal): Handle all signals defined by the | 21 | * w32proc.c (sys_signal): Handle all signals defined by the |
diff --git a/src/emacs.c b/src/emacs.c index 686a884cdbb..5aae812b869 100644 --- a/src/emacs.c +++ b/src/emacs.c | |||
| @@ -96,6 +96,11 @@ static const char emacs_copyright[] = COPYRIGHT; | |||
| 96 | /* Empty lisp strings. To avoid having to build any others. */ | 96 | /* Empty lisp strings. To avoid having to build any others. */ |
| 97 | Lisp_Object empty_unibyte_string, empty_multibyte_string; | 97 | Lisp_Object empty_unibyte_string, empty_multibyte_string; |
| 98 | 98 | ||
| 99 | #ifdef WINDOWSNT | ||
| 100 | /* Cache for externally loaded libraries. */ | ||
| 101 | Lisp_Object Vlibrary_cache; | ||
| 102 | #endif | ||
| 103 | |||
| 99 | /* Set after Emacs has started up the first time. | 104 | /* Set after Emacs has started up the first time. |
| 100 | Prevents reinitialization of the Lisp world and keymaps | 105 | Prevents reinitialization of the Lisp world and keymaps |
| 101 | on subsequent starts. */ | 106 | on subsequent starts. */ |
| @@ -2025,6 +2030,13 @@ You must run Emacs in batch mode in order to dump it. */) | |||
| 2025 | free (malloc_state_ptr); | 2030 | free (malloc_state_ptr); |
| 2026 | #endif | 2031 | #endif |
| 2027 | 2032 | ||
| 2033 | #ifdef WINDOWSNT | ||
| 2034 | Vlibrary_cache = Qnil; | ||
| 2035 | #endif | ||
| 2036 | #ifdef HAVE_WINDOW_SYSTEM | ||
| 2037 | reset_image_types (); | ||
| 2038 | #endif | ||
| 2039 | |||
| 2028 | Vpurify_flag = tem; | 2040 | Vpurify_flag = tem; |
| 2029 | 2041 | ||
| 2030 | return unbind_to (count, Qnil); | 2042 | return unbind_to (count, Qnil); |
| @@ -2357,6 +2369,11 @@ libraries; only those already known by Emacs will be loaded. */); | |||
| 2357 | Vdynamic_library_alist = Qnil; | 2369 | Vdynamic_library_alist = Qnil; |
| 2358 | Fput (intern_c_string ("dynamic-library-alist"), Qrisky_local_variable, Qt); | 2370 | Fput (intern_c_string ("dynamic-library-alist"), Qrisky_local_variable, Qt); |
| 2359 | 2371 | ||
| 2372 | #ifdef WINDOWSNT | ||
| 2373 | Vlibrary_cache = Qnil; | ||
| 2374 | staticpro (&Vlibrary_cache); | ||
| 2375 | #endif | ||
| 2376 | |||
| 2360 | /* Make sure IS_DAEMON starts up as false. */ | 2377 | /* Make sure IS_DAEMON starts up as false. */ |
| 2361 | daemon_pipe[1] = 0; | 2378 | daemon_pipe[1] = 0; |
| 2362 | } | 2379 | } |
diff --git a/src/image.c b/src/image.c index b9adf4ad480..7901b95f236 100644 --- a/src/image.c +++ b/src/image.c | |||
| @@ -8831,12 +8831,24 @@ lookup_image_type (Lisp_Object type) | |||
| 8831 | return NULL; | 8831 | return NULL; |
| 8832 | } | 8832 | } |
| 8833 | 8833 | ||
| 8834 | /* Reset image_types before dumping. | ||
| 8835 | Called from Fdump_emacs. */ | ||
| 8836 | |||
| 8837 | void | ||
| 8838 | reset_image_types (void) | ||
| 8839 | { | ||
| 8840 | while (image_types) | ||
| 8841 | { | ||
| 8842 | struct image_type *next = image_types->next; | ||
| 8843 | xfree (image_types); | ||
| 8844 | image_types = next; | ||
| 8845 | } | ||
| 8846 | } | ||
| 8847 | |||
| 8834 | void | 8848 | void |
| 8835 | syms_of_image (void) | 8849 | syms_of_image (void) |
| 8836 | { | 8850 | { |
| 8837 | /* Initialize this only once, since that's what we do with Vimage_types | 8851 | /* Initialize this only once; it will be reset before dumping. */ |
| 8838 | and they are supposed to be in sync. Initializing here gives correct | ||
| 8839 | operation on GNU/Linux of calling dump-emacs after loading some images. */ | ||
| 8840 | image_types = NULL; | 8852 | image_types = NULL; |
| 8841 | 8853 | ||
| 8842 | /* Must be defined now because we're going to update it below, while | 8854 | /* Must be defined now because we're going to update it below, while |
diff --git a/src/lisp.h b/src/lisp.h index 665ed17dfd0..35efa67e707 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -2731,6 +2731,7 @@ extern void init_fringe_once (void); | |||
| 2731 | extern Lisp_Object QCascent, QCmargin, QCrelief; | 2731 | extern Lisp_Object QCascent, QCmargin, QCrelief; |
| 2732 | extern Lisp_Object QCconversion; | 2732 | extern Lisp_Object QCconversion; |
| 2733 | extern int x_bitmap_mask (struct frame *, ptrdiff_t); | 2733 | extern int x_bitmap_mask (struct frame *, ptrdiff_t); |
| 2734 | extern void reset_image_types (void); | ||
| 2734 | extern void syms_of_image (void); | 2735 | extern void syms_of_image (void); |
| 2735 | 2736 | ||
| 2736 | /* Defined in insdel.c. */ | 2737 | /* Defined in insdel.c. */ |
| @@ -3284,6 +3285,9 @@ extern Lisp_Object empty_unibyte_string, empty_multibyte_string; | |||
| 3284 | extern Lisp_Object Qfile_name_handler_alist; | 3285 | extern Lisp_Object Qfile_name_handler_alist; |
| 3285 | extern _Noreturn void terminate_due_to_signal (int, int); | 3286 | extern _Noreturn void terminate_due_to_signal (int, int); |
| 3286 | extern Lisp_Object Qkill_emacs; | 3287 | extern Lisp_Object Qkill_emacs; |
| 3288 | #ifdef WINDOWSNT | ||
| 3289 | extern Lisp_Object Vlibrary_cache; | ||
| 3290 | #endif | ||
| 3287 | #if HAVE_SETLOCALE | 3291 | #if HAVE_SETLOCALE |
| 3288 | void fixup_locale (void); | 3292 | void fixup_locale (void); |
| 3289 | void synchronize_system_messages_locale (void); | 3293 | void synchronize_system_messages_locale (void); |
| @@ -6521,10 +6521,6 @@ sys_localtime (const time_t *t) | |||
| 6521 | 6521 | ||
| 6522 | 6522 | ||
| 6523 | 6523 | ||
| 6524 | /* Delayed loading of libraries. */ | ||
| 6525 | |||
| 6526 | Lisp_Object Vlibrary_cache; | ||
| 6527 | |||
| 6528 | /* Try loading LIBRARY_ID from the file(s) specified in | 6524 | /* Try loading LIBRARY_ID from the file(s) specified in |
| 6529 | Vdynamic_library_alist. If the library is loaded successfully, | 6525 | Vdynamic_library_alist. If the library is loaded successfully, |
| 6530 | return the handle of the DLL, and record the filename in the | 6526 | return the handle of the DLL, and record the filename in the |
| @@ -6769,9 +6765,6 @@ globals_of_w32 (void) | |||
| 6769 | 6765 | ||
| 6770 | DEFSYM (QCloaded_from, ":loaded-from"); | 6766 | DEFSYM (QCloaded_from, ":loaded-from"); |
| 6771 | 6767 | ||
| 6772 | Vlibrary_cache = Qnil; | ||
| 6773 | staticpro (&Vlibrary_cache); | ||
| 6774 | |||
| 6775 | g_b_init_is_windows_9x = 0; | 6768 | g_b_init_is_windows_9x = 0; |
| 6776 | g_b_init_open_process_token = 0; | 6769 | g_b_init_open_process_token = 0; |
| 6777 | g_b_init_get_token_information = 0; | 6770 | g_b_init_get_token_information = 0; |
| @@ -145,7 +145,7 @@ extern void check_windows_init_file (void); | |||
| 145 | extern int _sys_read_ahead (int fd); | 145 | extern int _sys_read_ahead (int fd); |
| 146 | extern int _sys_wait_accept (int fd); | 146 | extern int _sys_wait_accept (int fd); |
| 147 | 147 | ||
| 148 | extern Lisp_Object Vlibrary_cache, QCloaded_from; | 148 | extern Lisp_Object QCloaded_from; |
| 149 | extern HMODULE w32_delayed_load (Lisp_Object); | 149 | extern HMODULE w32_delayed_load (Lisp_Object); |
| 150 | 150 | ||
| 151 | #ifdef HAVE_GNUTLS | 151 | #ifdef HAVE_GNUTLS |