[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] /srv/bzr/emacs/trunk r105001: Merge: Remove more assumptio
From: |
Paul Eggert |
Subject: |
[Emacs-diffs] /srv/bzr/emacs/trunk r105001: Merge: Remove more assumptions re struct layout (Bug#8884). |
Date: |
Wed, 06 Jul 2011 15:23:30 -0700 |
User-agent: |
Bazaar (2.3.1) |
------------------------------------------------------------
revno: 105001 [merge]
committer: Paul Eggert <address@hidden>
branch nick: trunk
timestamp: Wed 2011-07-06 15:23:30 -0700
message:
Merge: Remove more assumptions re struct layout (Bug#8884).
modified:
src/ChangeLog
src/alloc.c
src/buffer.c
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog 2011-07-06 21:53:56 +0000
+++ b/src/ChangeLog 2011-07-06 22:22:32 +0000
@@ -1,7 +1,9 @@
2011-07-06 Paul Eggert <address@hidden>
Remove unportable assumption about struct layout (Bug#8884).
- * buffer.c (clone_per_buffer_values): Don't assume that
+ * alloc.c (mark_buffer):
+ * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
+ (clone_per_buffer_values): Don't assume that
sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
This isn't true in general, and it's particularly not true
if Emacs is configured with --with-wide-int.
=== modified file 'src/alloc.c'
--- a/src/alloc.c 2011-06-24 21:25:22 +0000
+++ b/src/alloc.c 2011-07-06 22:22:32 +0000
@@ -5619,7 +5619,8 @@
/* buffer-local Lisp variables start at `undo_list',
tho only the ones from `name' on are GC'd normally. */
for (ptr = &buffer->BUFFER_INTERNAL_FIELD (name);
- (char *)ptr < (char *)buffer + sizeof (struct buffer);
+ ptr <= &PER_BUFFER_VALUE (buffer,
+ PER_BUFFER_VAR_OFFSET (LAST_FIELD_PER_BUFFER));
ptr++)
mark_object (*ptr);
=== modified file 'src/buffer.c'
--- a/src/buffer.c 2011-07-06 21:53:56 +0000
+++ b/src/buffer.c 2011-07-06 22:22:32 +0000
@@ -830,8 +830,8 @@
/* buffer-local Lisp variables start at `undo_list',
tho only the ones from `name' on are GC'd normally. */
- for (offset = PER_BUFFER_VAR_OFFSET (undo_list);
- offset < sizeof *b;
+ for (offset = PER_BUFFER_VAR_OFFSET (FIRST_FIELD_PER_BUFFER);
+ offset <= PER_BUFFER_VAR_OFFSET (LAST_FIELD_PER_BUFFER);
offset += sizeof (Lisp_Object))
{
int idx = PER_BUFFER_IDX (offset);
@@ -1055,8 +1055,8 @@
/* buffer-local Lisp variables start at `undo_list',
tho only the ones from `name' on are GC'd normally. */
- for (offset = PER_BUFFER_VAR_OFFSET (undo_list);
- offset < sizeof (struct buffer);
+ for (offset = PER_BUFFER_VAR_OFFSET (FIRST_FIELD_PER_BUFFER);
+ offset <= PER_BUFFER_VAR_OFFSET (LAST_FIELD_PER_BUFFER);
/* sizeof EMACS_INT == sizeof Lisp_Object */
offset += (sizeof (EMACS_INT)))
{
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] /srv/bzr/emacs/trunk r105001: Merge: Remove more assumptions re struct layout (Bug#8884).,
Paul Eggert <=