projects
/
chise
/
xemacs-chise.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Sync with r21-4-9-utf-2000-0_19-jc3lisp.
[chise/xemacs-chise.git]
/
src
/
opaque.c
diff --git
a/src/opaque.c
b/src/opaque.c
index
1b080e5
..
976ecd7
100644
(file)
--- a/
src/opaque.c
+++ b/
src/opaque.c
@@
-52,11
+52,17
@@
print_opaque (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag)
write_c_string (buf, printcharfun);
}
write_c_string (buf, printcharfun);
}
+inline static size_t
+aligned_sizeof_opaque (size_t opaque_size)
+{
+ return ALIGN_SIZE (offsetof (Lisp_Opaque, data) + opaque_size,
+ ALIGNOF (max_align_t));
+}
+
static size_t
sizeof_opaque (const void *header)
{
static size_t
sizeof_opaque (const void *header)
{
- const Lisp_Opaque *p = (const Lisp_Opaque *) header;
- return offsetof (Lisp_Opaque, data) + p->size;
+ return aligned_sizeof_opaque (((const Lisp_Opaque *) header)->size);
}
/* Return an opaque object of size SIZE.
}
/* Return an opaque object of size SIZE.
@@
-67,7
+73,7
@@
Lisp_Object
make_opaque (const void *data, size_t size)
{
Lisp_Opaque *p = (Lisp_Opaque *)
make_opaque (const void *data, size_t size)
{
Lisp_Opaque *p = (Lisp_Opaque *)
- alloc_lcrecord (offsetof (Lisp_Opaque, data) + size, &lrecord_opaque);
+ alloc_lcrecord (aligned_sizeof_opaque (size), &lrecord_opaque);
p->size = size;
if (data == OPAQUE_CLEAR)
p->size = size;
if (data == OPAQUE_CLEAR)
@@
-124,7
+130,7
@@
print_opaque_ptr (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag)
const Lisp_Opaque_Ptr *p = XOPAQUE_PTR (obj);
char buf[200];
const Lisp_Opaque_Ptr *p = XOPAQUE_PTR (obj);
char buf[200];
- sprintf (buf, "#<INTERNAL OBJECT (XEmacs bug?) (opaque_ptr, adr=0x%lx) 0x%lx>",
+ sprintf (buf, "#<INTERNAL OBJECT (XEmacs bug?) (opaque-ptr, adr=0x%lx) 0x%lx>",
(long)(p->ptr), (unsigned long) p);
write_c_string (buf, printcharfun);
}
(long)(p->ptr), (unsigned long) p);
write_c_string (buf, printcharfun);
}
@@
-141,7
+147,7
@@
hash_opaque_ptr (Lisp_Object obj, int depth)
return (unsigned long) XOPAQUE_PTR (obj)->ptr;
}
return (unsigned long) XOPAQUE_PTR (obj)->ptr;
}
-DEFINE_LRECORD_IMPLEMENTATION ("opaque_ptr", opaque_ptr,
+DEFINE_LRECORD_IMPLEMENTATION ("opaque-ptr", opaque_ptr,
0, print_opaque_ptr, 0,
equal_opaque_ptr, hash_opaque_ptr, 0,
Lisp_Opaque_Ptr);
0, print_opaque_ptr, 0,
equal_opaque_ptr, hash_opaque_ptr, 0,
Lisp_Opaque_Ptr);