summaryrefslogtreecommitdiff
path: root/src/alloc.c
diff options
context:
space:
mode:
authorJim Blandy <jimb@redhat.com>1993-02-22 16:21:17 +0000
committerJim Blandy <jimb@redhat.com>1993-02-22 16:21:17 +0000
commitfe90ad97661b86fac9c360272330008b16f3054e (patch)
tree9f694bc6fa1ca74050d4155faae0ede2092b0fda /src/alloc.c
parentb10fd412fcb92bd9c5e7d610430863a68d9e0494 (diff)
downloademacs-fe90ad97661b86fac9c360272330008b16f3054e.tar.gz
emacs-fe90ad97661b86fac9c360272330008b16f3054e.tar.bz2
emacs-fe90ad97661b86fac9c360272330008b16f3054e.zip
* alloc.c (make_pure_float): Align pureptr according to __alignof,
if it's available, or sizeof (struct Lisp_Float) if it's not.
Diffstat (limited to 'src/alloc.c')
-rw-r--r--src/alloc.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/alloc.c b/src/alloc.c
index 63463dbbc7f..f3010dbac5d 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -991,12 +991,22 @@ make_pure_float (num)
double num;
{
register Lisp_Object new;
+ int alignment;
/* Make sure that pureptr is aligned on at least a sizeof (double)
boundary. Some architectures (like the sparc) require this, and
I suspect that floats are rare enough that it's no tragedy for
those that do. */
- pureptr = (pureptr + sizeof (num) - 1) & - sizeof (num);
+#ifdef __GNUC__
+#if __GNUC__ >= 2
+ alignment = __alignof (struct Lisp_Float);
+#else
+ alignment = sizeof (struct Lisp_Float);
+#endif
+#else
+ alignment = sizeof (struct Lisp_Float);
+#endif
+ pureptr = (pureptr + alignment - 1) & - alignment;
if (pureptr + sizeof (struct Lisp_Float) > PURESIZE)
error ("Pure Lisp storage exhausted");