on subsequent starts. */
int initialized;
+#ifdef DOUG_LEA_MALLOC
+/* Preserves a pointer to the memory allocated that copies that
+ static data inside glibc's malloc. */
+void *malloc_state_ptr;
+/* From glibc, a routine that returns a copy of the malloc internal state. */
+extern void *malloc_get_state ();
+/* From glibc, a routine that overwrites the malloc internal state. */
+extern void malloc_set_state ();
+#endif
+
/* Variable whose value is symbol giving operating system type. */
Lisp_Object Vsystem_type;
not including lisp and info. */
tem = Fexpand_file_name (build_string ("lib-src"), dir);
lib_src_exists = Ffile_exists_p (tem);
- if (!NILP (lib_src_exists))
+
+#ifdef MSDOS
+ /* MSDOS installations frequently remove lib-src, but we still
+ must set installation-directory, or else info won't find
+ its files (it uses the value of installation-directory). */
+ tem = Fexpand_file_name (build_string ("info"), dir);
+ info_exists = Ffile_exists_p (tem);
+#else
+ info_exists = Qnil;
+#endif
+
+ if (!NILP (lib_src_exists) || !NILP (info_exists))
{
tem = Fexpand_file_name (build_string ("etc"), dir);
etc_exists = Ffile_exists_p (tem);
/* See if dir's parent contains those subdirs. */
tem = Fexpand_file_name (build_string ("../lib-src"), dir);
lib_src_exists = Ffile_exists_p (tem);
- if (!NILP (lib_src_exists))
+
+
+#ifdef MSDOS
+ /* See the MSDOS commentary above. */
+ tem = Fexpand_file_name (build_string ("../info"), dir);
+ info_exists = Ffile_exists_p (tem);
+#else
+ info_exists = Qnil;
+#endif
+
+ if (!NILP (lib_src_exists) || !NILP (info_exists))
{
tem = Fexpand_file_name (build_string ("../etc"), dir);
etc_exists = Ffile_exists_p (tem);
__sbrk (1);
#endif
+#ifdef DOUG_LEA_MALLOC
+ if (initialized)
+ {
+ malloc_set_state (malloc_state_ptr);
+ free (malloc_state_ptr);
+ }
+#endif
+
sort_args (argc, argv);
if (argmatch (argv, argc, "-version", "--version", 3, NULL, &skip_args))
/* Extend the stack space available. */
if (!getrlimit (RLIMIT_STACK, &rlim))
{
- rlim.rlim_cur = rlim.rlim_max;
+ long newlim;
+ /* Approximate the amount regex.c needs, plus some more. */
+ newlim = 800000 * sizeof (char *);
+ if (newlim > rlim.rlim_max)
+ newlim = rlim.rlim_max;
+ if (rlim.rlim_cur < newlim)
+ rlim.rlim_cur = newlim;
+
setrlimit (RLIMIT_STACK, &rlim);
}
#endif
init_alloc_once ();
init_obarray ();
init_eval_once ();
+ init_charset_once ();
+ init_coding_once ();
init_syntax_once (); /* Create standard syntax table. */
+ init_category_once (); /* Create standard category table. */
/* Must be done before init_buffer */
init_casetab_once ();
init_buffer_once (); /* Create buffer table and some buffers */
syms_of_casefiddle ();
syms_of_casetab ();
syms_of_callproc ();
+ syms_of_category ();
+ syms_of_ccl ();
+ syms_of_charset ();
syms_of_cmds ();
#ifndef NO_DIR_LIBRARY
syms_of_dired ();
syms_of_editfns ();
syms_of_emacs ();
syms_of_fileio ();
+ syms_of_coding (); /* This should be after syms_of_fileio. */
#ifdef CLASH_DETECTION
syms_of_filelock ();
#endif /* CLASH_DETECTION */
syms_of_xterm ();
syms_of_xfns ();
syms_of_xfaces ();
+ syms_of_fontset ();
#ifdef HAVE_X11
syms_of_xselect ();
#endif
}
bcopy (new, argv, sizeof (char *) * argc);
+
+ free (options);
+ free (new);
+ free (priority);
}
\f
DEFUN ("kill-emacs", Fkill_emacs, Skill_emacs, 0, 1, "P",
Meanwhile, my_edata is not valid on Windows. */
memory_warnings (my_edata, malloc_warning);
#endif /* not WINDOWSNT */
+#endif
+#ifdef DOUG_LEA_MALLOC
+ malloc_state_ptr = malloc_get_state ();
#endif
unexec (XSTRING (filename)->data,
!NILP (symfile) ? XSTRING (symfile)->data : 0, my_edata, 0, 0);
+#ifdef DOUG_LEA_MALLOC
+ free (malloc_state_ptr);
+#endif
#endif /* not VMS */
Vpurify_flag = tem;