# HG changeset patch # User crestani # Date 1127994082 0 # Node ID 288869ac83b56416caec00788ecfb225ba5198fe # Parent 62d146e2f3ec8221f63546e9f6fbb6c05eb30b2b [xemacs-hg @ 2005-09-29 11:41:21 by crestani] Fix new allocator's module support. diff -r 62d146e2f3ec -r 288869ac83b5 src/ChangeLog --- a/src/ChangeLog Wed Sep 28 21:51:16 2005 +0000 +++ b/src/ChangeLog Thu Sep 29 11:41:22 2005 +0000 @@ -1,3 +1,8 @@ +2005-09-26 Marcus Crestani + + * symbols.c (check_module_subr): Fix new allocator's module + support: remove duplicating the subr. + 2005-09-27 Ben Wing * glyphs.c: diff -r 62d146e2f3ec -r 288869ac83b5 src/symbols.c --- a/src/symbols.c Wed Sep 28 21:51:16 2005 +0000 +++ b/src/symbols.c Thu Sep 29 11:41:22 2005 +0000 @@ -3474,6 +3474,7 @@ #endif #ifdef HAVE_SHLIB +#ifndef MC_ALLOC /* * If we are not in a pure undumped Emacs, we need to make a duplicate of * the subr. This is because the only time this function will be called @@ -3533,6 +3534,45 @@ subr = newsubr; \ } \ } while (0) +#else /* MC_ALLOC */ +/* + * If we have the new allocator enabled, we do not need to make a + * duplicate of the subr. The new allocator already does allocate all + * subrs in Lisp-accessible memory rather than have it in the static + * subr struct. + * + * NOTE: The DOC pointer is not set here as described above. + */ +#define check_module_subr(subr) \ +do { \ + if (initialized) { \ + Lisp_Object f; \ + \ + if (subr->min_args < 0) \ + signal_ferror (Qdll_error, "%s min_args (%hd) too small", \ + subr_name (subr), subr->min_args); \ + if (subr->min_args > SUBR_MAX_ARGS) \ + signal_ferror (Qdll_error, "%s min_args (%hd) too big (max = %d)", \ + subr_name (subr), subr->min_args, SUBR_MAX_ARGS); \ + \ + if (subr->max_args != MANY && \ + subr->max_args != UNEVALLED) \ + { \ + /* Need to fix lisp.h and eval.c if SUBR_MAX_ARGS too small */ \ + if (subr->max_args > SUBR_MAX_ARGS) \ + signal_ferror (Qdll_error, "%s max_args (%hd) too big (max = %d)", \ + subr_name (subr), subr->max_args, SUBR_MAX_ARGS); \ + if (subr->min_args > subr->max_args) \ + signal_ferror (Qdll_error, "%s min_args (%hd) > max_args (%hd)", \ + subr_name (subr), subr->min_args, subr->max_args); \ + } \ + \ + f = XSYMBOL (sym)->function; \ + if (!UNBOUNDP (f) && (!CONSP (f) || !EQ (XCAR (f), Qautoload))) \ + signal_ferror (Qdll_error, "Attempt to redefine %s", subr_name (subr)); \ + } \ +} while (0) +#endif /* MC_ALLOC */ #else /* ! HAVE_SHLIB */ #define check_module_subr(subr) #endif