all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* USE_LSB_TAG and MS-DOS
@ 2004-05-15 13:07 Eli Zaretskii
  2004-05-15 15:10 ` Jason Rumney
  2004-05-16 23:40 ` Stefan Monnier
  0 siblings, 2 replies; 27+ messages in thread
From: Eli Zaretskii @ 2004-05-15 13:07 UTC (permalink / raw)


For whom it may concern: I've checked in a change to lisp.h that
disables the use of USE_LSB_TAG in the MS-DOS port.  USE_LSB_TAG was
turned on by a recent change in lisp.h because the MS-DOS build uses
the GNU malloc and GCC, but that caused temacs to crash with SIGABRT
during loadup when it performed the first GC.

If Stefan, or someone else who understand the intricacies of
USE_LSB_TAG and what it demands from the underlying platform, wishes
to help me debug this, in the hope that we will learn something
interesting about other platforms where USE_LSB_TAG could fail, I'll
be glad to dig deeper into the reasons for the crash.  Otherwise, I
don't have resources to debug this myself, and I don't see any
catastrophe to leave the MS-DOS port with the 256-MB max buffer size.
(FWIW, I suspect that stack alignment has something to do with the
crash, but I didn't look into this deep enough to be sure.)

Btw, the way DECL_ALIGN and USE_LSB_TAG are defined on lisp.h doesn't
leave any elegant way for specific platforms to turn that off without
cluttering lisp.h with ugly OS-specific #ifdef's.  Perhaps we should
devise a cleaner way.

^ permalink raw reply	[flat|nested] 27+ messages in thread
* Re: USE_LSB_TAG and MS-DOS
@ 2004-05-18 19:08 Michael Mauger
  2004-05-18 22:10 ` Stefan Monnier
  2004-05-18 23:32 ` Jason Rumney
  0 siblings, 2 replies; 27+ messages in thread
From: Michael Mauger @ 2004-05-18 19:08 UTC (permalink / raw)


Below is a patch for the W32 MinGW (GCC) build with USE_LSB_TAG enabled.

There were a couple of references to VALMASK which didn't make sense with
USE_LSB_TAG.  There were also a couple of color functions that returned
W32 COLORREFs but treated the return value as Lisp_Int objects.  (Thanks
to YAMAMOTO Mitsuharu for pointing us in the right direction.)

I'm now building and using the USE_LSB_TAG emacs on W32 without obvious
problems.

Please review and apply if acceptable.

2004-05-18  Michael Mauger  <mmaug@yahoo.com>

	* emacs/src/w32fns.c (w32_color_map_lookup): Return Lisp_Object,
	not COLORREF.
	(x_to_w32_color): Return Lisp_Object, not COLORREF.
	* emacs/src/w32proc.c (create_child) [USE_LSB_TAG]: Don't mask
	out upper bits of pid.
	* emacs/src/w32heap.c (init_heap) [USE_LSB_TAG]: Don't check
	address range.


Index: emacs/src/w32heap.c
===================================================================
RCS file: /c/cvsroot/emacs/emacs/src/w32heap.c,v
retrieving revision 1.23
diff -u -r1.23 w32heap.c
--- emacs/src/w32heap.c	1 Sep 2003 15:45:57 -0000	1.23
+++ emacs/src/w32heap.c	18 May 2004 18:14:04 -0000
@@ -245,6 +245,7 @@
 	  exit (1);
 	}

+#ifndef USE_LSB_TAG
       /* Ensure that the addresses don't use the upper tag bits since
 	 the Lisp type goes there.  */
       if (((unsigned long) data_region_base & ~VALMASK) != 0)
@@ -252,6 +253,7 @@
 	  printf ("Error: The heap was allocated in upper memory.\n");
 	  exit (1);
 	}
+#endif

       data_region_end = data_region_base;
       real_data_region_end = data_region_end;
Index: emacs/src/w32proc.c
===================================================================
RCS file: /c/cvsroot/emacs/emacs/src/w32proc.c,v
retrieving revision 1.56
diff -u -r1.56 w32proc.c
--- emacs/src/w32proc.c	1 Sep 2003 15:45:57 -0000	1.56
+++ emacs/src/w32proc.c	18 May 2004 18:31:13 -0000
@@ -366,8 +366,10 @@
   if (cp->pid < 0)
     cp->pid = -cp->pid;

+#ifndef USE_LSB_TAG
   /* pid must fit in a Lisp_Int */
   cp->pid = (cp->pid & VALMASK);
+#endif

   *pPid = cp->pid;

Index: emacs/src/w32fns.c
===================================================================
RCS file: /c/cvsroot/emacs/emacs/src/w32fns.c,v
retrieving revision 1.232
diff -u -r1.232 w32fns.c
--- emacs/src/w32fns.c	14 May 2004 17:37:26 -0000	1.232
+++ emacs/src/w32fns.c	18 May 2004 18:15:19 -0000
@@ -828,7 +828,7 @@
     return Qnil;
 }

-COLORREF
+Lisp_Object
 w32_color_map_lookup (colorname)
      char *colorname;
 {
@@ -847,7 +847,7 @@

       if (lstrcmpi (SDATA (tem), colorname) == 0)
 	{
-	  ret = XUINT (Fcdr (elt));
+	  ret = Fcdr (elt);
 	  break;
 	}

@@ -910,7 +910,7 @@
 }


-COLORREF
+Lisp_Object
 x_to_w32_color (colorname)
      char * colorname;
 {
@@ -970,7 +970,7 @@
 	      if (i == 2)
 		{
 		  UNBLOCK_INPUT;
-		  return (colorval);
+		  return (make_number (colorval));
 		}
 	      color = end;
 	    }
@@ -1023,7 +1023,7 @@
 	      if (*end != '\0')
 		break;
 	      UNBLOCK_INPUT;
-	      return (colorval);
+	      return (make_number (colorval));
 	    }
 	  if (*end != '/')
 	    break;
@@ -1064,7 +1064,7 @@
 	      if (*end != '\0')
 		break;
 	      UNBLOCK_INPUT;
-	      return (colorval);
+	      return (make_number (colorval));
 	    }
 	  if (*end != '/')
 	    break;

^ permalink raw reply	[flat|nested] 27+ messages in thread

end of thread, other threads:[~2004-05-20 16:34 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-05-15 13:07 USE_LSB_TAG and MS-DOS Eli Zaretskii
2004-05-15 15:10 ` Jason Rumney
2004-05-15 18:24   ` Eli Zaretskii
2004-05-17  8:13     ` Jason Rumney
2004-05-17  8:45       ` YAMAMOTO Mitsuharu
2004-05-18 20:34         ` Jason Rumney
2004-05-17 10:13       ` Eli Zaretskii
2004-05-17 10:30         ` Jason Rumney
2004-05-16 23:40 ` Stefan Monnier
2004-05-17  6:10   ` Eli Zaretskii
2004-05-17 16:22     ` Stefan Monnier
2004-05-17 22:31       ` Miles Bader
2004-05-18 13:36         ` Stefan Monnier
2004-05-18 15:00       ` Eli Zaretskii
2004-05-18 14:59         ` Andreas Schwab
2004-05-18 15:13         ` Stefan Monnier
2004-05-18 18:45           ` Eli Zaretskii
2004-05-18 19:12             ` Stefan Monnier
2004-05-19  6:25               ` Eli Zaretskii
2004-05-20 16:34               ` Eli Zaretskii
2004-05-18 15:08   ` Eli Zaretskii
2004-05-18 15:18     ` Stefan Monnier
2004-05-18 15:09   ` Eli Zaretskii
  -- strict thread matches above, loose matches on Subject: below --
2004-05-18 19:08 Michael Mauger
2004-05-18 22:10 ` Stefan Monnier
2004-05-18 23:32 ` Jason Rumney
2004-05-19 14:58   ` Michael Mauger

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.