Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
emacs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
emacs
emacs
Commits
8a5c77bb
Commit
8a5c77bb
authored
Jul 06, 2011
by
Paul Eggert
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove more assumptions re struct layout (Bug#8884).
parent
437dd18b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
6 deletions
+9
-6
src/ChangeLog
src/ChangeLog
+3
-1
src/alloc.c
src/alloc.c
+2
-1
src/buffer.c
src/buffer.c
+4
-4
No files found.
src/ChangeLog
View file @
8a5c77bb
2011-07-06 Paul Eggert <eggert@cs.ucla.edu>
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.
...
...
src/alloc.c
View file @
8a5c77bb
...
...
@@ -5619,7 +5619,8 @@ mark_buffer (Lisp_Object buf)
/* 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
);
...
...
src/buffer.c
View file @
8a5c77bb
...
...
@@ -830,8 +830,8 @@ reset_buffer_local_variables (register struct buffer *b, int permanent_too)
/* 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 @@ No argument or nil as argument means use current buffer as BUFFER. */)
/* 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)))
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment