Merge remote-tracking branch 'origin/master' into for-steve
authorNelson Ferreira <nelson.ferreira@ieee.org>
Sat, 10 Mar 2012 00:00:38 +0000 (19:00 -0500)
committerNelson Ferreira <nelson.ferreira@ieee.org>
Sat, 10 Mar 2012 00:00:38 +0000 (19:00 -0500)
modules/ase/ase-heap.c
modules/ase/ase-heap.h
src/Makefile.am
src/category.h
src/dumper.c
src/lrecord.h
src/sxe-paths.h.in
tests/Makefile.am
tests/automated/lisp-tests.el

index e5757e1..9ab2c03 100644 (file)
@@ -62,6 +62,13 @@ Lisp_Object Qweak, Qdense, Qdynamic, Q_kind, Q_relation, Q_coloured;
 #define ASE_HEAP_MIN_SIZE      4096    /* 65536 */
 #define ALIGNED(n)     __attribute__((aligned(n), packed))
 
+static inline ase_yheap_t _ase_make_yheap(ase_heap_options_t opts);
+static inline Lisp_Object _ase_wrap_yheap(ase_yheap_t);
+static inline ase_dheap_t _ase_make_dheap(ase_heap_options_t opts);
+static inline Lisp_Object _ase_wrap_dheap(ase_dheap_t);
+static inline ase_wheap_t _ase_make_wheap(ase_heap_options_t opts);
+static inline Lisp_Object _ase_wrap_wheap(ase_wheap_t);
+
 /* the op tables */
 struct ase_heap_ops_s ase_heap_ops[NUMBER_OF_ASE_HEAP_KINDS] =
 {{(ase_heap_constr_f)_ase_make_yheap, (ase_heap_wrap_f)_ase_wrap_yheap,
@@ -527,7 +534,7 @@ _ase_make_heap_cell(ase_yheap_cell_t mother)
        return c;
 }
 
-Lisp_Object
+static inline Lisp_Object
 _ase_wrap_yheap(ase_yheap_t h)
 {
        Lisp_Object result;
@@ -547,7 +554,7 @@ _ase_wrap_yheap(ase_yheap_t h)
        return result;
 }
 
-Lisp_Object
+static inline Lisp_Object
 _ase_wrap_dheap(ase_dheap_t h)
 {
        Lisp_Object result;
@@ -567,7 +574,7 @@ _ase_wrap_dheap(ase_dheap_t h)
        return result;
 }
 
-ase_dheap_t
+static inline ase_dheap_t
 _ase_make_dheap(ase_heap_options_t opts)
 {
        ase_dheap_t h = xnew(struct ase_dheap_s);
@@ -604,7 +611,7 @@ Lisp_Object ase_make_dheap(ase_heap_options_t opts)
        return _ase_wrap_dheap(h);
 }
 
-Lisp_Object
+static inline Lisp_Object
 _ase_wrap_wheap(ase_wheap_t h)
 {
        Lisp_Object result;
@@ -624,7 +631,7 @@ _ase_wrap_wheap(ase_wheap_t h)
        return result;
 }
 
-ase_wheap_t
+static inline ase_wheap_t
 _ase_make_wheap(ase_heap_options_t opts)
 {
        ase_wheap_t h = xnew(struct ase_wheap_s);
@@ -664,7 +671,7 @@ Lisp_Object ase_make_wheap(ase_heap_options_t opts)
        return _ase_wrap_wheap(h);
 }
 
-inline ase_yheap_t
+static inline ase_yheap_t
 _ase_make_yheap(ase_heap_options_t opts)
 {
        ase_yheap_t h = xnew(struct ase_yheap_s);
index 4233201..460a340 100644 (file)
@@ -287,8 +287,6 @@ extern Lisp_Object ase_wheap_to_dllist(ase_wheap_t);
 
 \f
 /* dyna heaps */
-static inline ase_yheap_t _ase_make_yheap(ase_heap_options_t opts);
-static inline Lisp_Object _ase_wrap_yheap(ase_yheap_t);
 extern Lisp_Object ase_make_yheap(ase_heap_options_t opts);
 extern void ase_add_yheap(ase_yheap_t h, Lisp_Object o, Lisp_Object colour);
 extern Lisp_Object ase_pop_yheap(ase_yheap_t h);
@@ -296,8 +294,6 @@ extern Lisp_Object ase_yheap_top(ase_yheap_t h);
 extern Lisp_Object ase_yheap_top_rank(ase_yheap_t h);
 
 /* dense heaps */
-static inline ase_dheap_t _ase_make_dheap(ase_heap_options_t opts);
-static inline Lisp_Object _ase_wrap_dheap(ase_dheap_t);
 extern Lisp_Object ase_make_dheap(ase_heap_options_t opts);
 extern void ase_add_dheap(ase_dheap_t h, Lisp_Object o, Lisp_Object colour);
 extern Lisp_Object ase_pop_dheap(ase_dheap_t h);
@@ -305,8 +301,6 @@ extern Lisp_Object ase_dheap_top(ase_dheap_t h);
 extern Lisp_Object ase_dheap_top_rank(ase_dheap_t h);
 
 /* weak heaps */
-static inline ase_wheap_t _ase_make_wheap(ase_heap_options_t opts);
-static inline Lisp_Object _ase_wrap_wheap(ase_wheap_t);
 extern Lisp_Object ase_make_wheap(ase_heap_options_t opts);
 extern void ase_add_wheap(ase_wheap_t h, Lisp_Object o, Lisp_Object colour);
 extern Lisp_Object ase_pop_wheap(ase_wheap_t h);
index 1d6bc48..0b30b98 100644 (file)
@@ -58,7 +58,7 @@ ETAGS = $(top_builddir)/lib-src/etags
 TAGS_DEPENDENCIES = $(ETAGS)
 
 bin_PROGRAMS = sxemacs
-bin_SCRIPTS = sxemacs.dmp
+noinst_DATA = sxemacs.dmp
 archlib_DATA = config.values DOC
 
 pdumplibs =
@@ -320,9 +320,8 @@ config.values: config.h
 ## relinked sxemacs
 ## one day (when SXE is linked with its own shared libraries) we HAVE to
 ## go that way but at the moment it's okay the way it is
-SXEDMP_FILEEXT=dmp
-SXEMACS_FILENAME=sxemacs
-SXEDMP_FILENAME=$(SXEMACS_FILENAME).$(SXEDMP_FILEEXT)
+SXE_SHOW_DUMP = $$($(BITCHENV) $(DESTDIR)$(bindir)/sxemacs -sd)
+SXEDMP_FILENAME=sxemacs-$(old_version)-$(SXE_SHOW_DUMP).dmp
 
 sxemacs.dmp: $(SXEMACS) $(archlib_DATA) $(bldlispdir)/update-elc.stamp
        if test -e "$(bldlispdir)/update-elc.stamp"; then \
@@ -345,17 +344,15 @@ sxemacs.dmp: $(SXEMACS) $(archlib_DATA) $(bldlispdir)/update-elc.stamp
 $(bldlispdir)/update-elc.stamp $(bldlispdir)/auto.stamp:
        :
 
-SXE_SHOW_DUMP = $$($(BITCHENV) $(DESTDIR)$(bindir)/sxemacs -sd)
-
 ## improve me, make me (the dump file) independent from the binary
+## because of historical reasons we also delete $(bindir)/sxemacs.dmp here
 install-exec-hook:
        (cd $(DESTDIR)$(bindir) && $(RM) sxemacs.dmp)
+       (cd $(DESTDIR)$(archlibdir) && $(RM) sxemacs.dmp)
        (cd $(abs_builddir); \
        $(BITCHENV) $(DESTDIR)$(bindir)/sxemacs -nd -batch \
                -l $(sxelispdir)/loadup.el \
-               --dump $(DESTDIR)$(bindir)/sxemacs-$(old_version)-$(SXE_SHOW_DUMP).dmp)
-       (cd $(DESTDIR)$(bindir) && \
-               $(LN_S) sxemacs-$(old_version)-$(SXE_SHOW_DUMP).dmp sxemacs.dmp)
+               --dump $(DESTDIR)$(archlibdir)/$(SXEDMP_FILENAME))
 
 
 ## someone who wants to use this actually needs repeat the fuss above
index bb21c57..88562f0 100644 (file)
@@ -55,8 +55,6 @@ typedef enum cat_morphism_kind_e cat_morphism_kind_t;
 
 extern_inline bool __bit_set_p(int number, char bit);
 extern_inline char __nbits_right_of(int number, char bit);
-extern_inline void *cat_morphism(const void*, cat_morphism_kind_t);
-extern_inline void *const*cat_morphisms(const void*);
 extern cat_morphism_t morphisms;
 
 \f
@@ -167,7 +165,7 @@ __nbits_right_of(int number, char bit)
 #endif
 
 #if 1                          /* using the global shit */
-extern_inline void*const*
+static inline void*const*
 cat_morphisms(const void *obj)
 {
 /* returns a pointer to the array of implementations or
@@ -179,7 +177,7 @@ cat_morphisms(const void *obj)
        }
 }
 
-extern_inline void*
+static inline void*
 cat_morphism(const void *obj, cat_morphism_kind_t kind)
 {
        unsigned int flags = ((const struct lrecord_header*)obj)->morphisms;
@@ -207,5 +205,8 @@ cat_morphism(const void *obj, cat_morphism_kind_t kind)
                return mph[__nbits_right_of(flags, kind)-(flags&1)];
        }
 }
+#else  /* use definition in category.c */
+extern void *cat_morphism(const void*, cat_morphism_kind_t);
+extern void *const*cat_morphisms(const void*);
 #endif
 #endif /* INCLUDED_category_h_ */
index 978fc73..1b0d3f8 100644 (file)
@@ -34,6 +34,9 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>. */
 #include <sys/mman.h>
 #endif
 
+/* For PATH_EXEC */
+#include <sxe-paths.h>
+
 #ifndef SEPCHAR
 #define SEPCHAR ':'
 #endif
@@ -1356,6 +1359,7 @@ wipe_out_libtool_stuff(char *path)
 int pdump_load(const char *argv0)
 {
        char exe_path[PATH_MAX], real_exe_path[PATH_MAX];
+       char libarchdir_path[PATH_MAX] = PATH_EXEC "/sxemacs";
        char *w;
        const char *dir, *p;
 
@@ -1445,7 +1449,8 @@ int pdump_load(const char *argv0)
        xstrncpy(real_exe_path, exe_path, sizeof(real_exe_path));
        if (pdump_file_try(exe_path,sizeof(exe_path))
            || (xrealpath(real_exe_path, real_exe_path)
-               && pdump_file_try(real_exe_path,sizeof(real_exe_path)))) {
+               && pdump_file_try(real_exe_path,sizeof(real_exe_path)))
+           || pdump_file_try(libarchdir_path,sizeof(libarchdir_path)) ) {
                pdump_load_finish();
                return 1;
        }
index 0642434..40d58d7 100644 (file)
@@ -74,8 +74,9 @@ struct lrecord_header {
        /* 1 if the object is readonly from lisp */
        unsigned int lisp_readonly:1;
 
-       long unsigned int hash_cache;
        unsigned int morphisms:/*number_of_cat_morphism_kinds => */6;
+
+       long unsigned int hash_cache;
 };
 
 struct lrecord_implementation;
@@ -88,6 +89,8 @@ int lrecord_type_index(const struct lrecord_implementation *implementation);
                SLI_header->mark = 0;                           \
                SLI_header->c_readonly = 0;                     \
                SLI_header->lisp_readonly = 0;                  \
+               SLI_header->morphisms = 0;                      \
+               SLI_header->hash_cache = 0;                     \
        } while (0)
 
 struct lcrecord_header {
index 418ea39..b96cabe 100644 (file)
@@ -88,9 +88,7 @@
 #define PATH_PACKAGEPATH "@PACKAGE_PATH@"
 #endif
 
-#ifdef ARCHLIBDIR_USER_DEFINED
 #define PATH_EXEC "@ARCHLIBDIR@"
-#endif
 
 #ifdef ETCDIR_USER_DEFINED
 #define PATH_DATA "@ETCDIR@"
index 976b3e0..8dcc40c 100644 (file)
@@ -73,7 +73,8 @@ CLEANFILES = stage1 stage2
 SXE_DYLD_PATH = $(bldsrcdir):$(bldsrcdir)/$(LT_OBJDIR):$(bldlwlibdir):$(bldlwlibdir)/$(LT_OBJDIR):$(DESTDIR)$(libdir)
 BATCHENV = DYLD_LIBRARY_PATH=$(SXE_DYLD_PATH):$$DYLD_LIBRARY_PATH:$(DYLD_LIBRARY_PATH) \
        LD_LIBRARY_PATH=$(SXE_DYLD_PATH):$$LD_LIBRARY_PATH:$(LD_LIBRARY_PATH) \
-       SHLIB_PATH=$(SXE_DYLD_PATH):$$SHLIB_PATH:$(SHLIB_PATH)
+       SHLIB_PATH=$(SXE_DYLD_PATH):$$SHLIB_PATH:$(SHLIB_PATH) \
+       MALLOC_PERTURB_=69
 ### Produces strange banner
 SXEMACS = $(bldsrcdir)/sxemacs
 SXEDMP = $(SXEMACS).dmp
index 13a08e9..92a02f6 100644 (file)
@@ -61,6 +61,9 @@
   (test-setq 42  (setq-default test-setq-bar 99 test-setq-var 42))
   )
 
+;; Following test dies on recent libc's with MALLOC_PERTURB_=69
+(Check-Error wrong-type-argument (length (current-buffer)))
+
 (let ((my-vector [1 2 3 4])
       (my-bit-vector (bit-vector 1 0 1 0))
       (my-string "1234")