aboutsummaryrefslogtreecommitdiffstats
path: root/src/alloc.c
diff options
context:
space:
mode:
authorStefan Monnier2011-02-21 17:34:51 -0500
committerStefan Monnier2011-02-21 17:34:51 -0500
commitf619ad4ca2ce943d53589469c010e451afab97dd (patch)
treee1b71f79518372ecab4c677ae948504450d8bf5d /src/alloc.c
parenta647cb26b695a542e3a546104afdf4c7c47eb061 (diff)
parent9f8370e63f65f76887b319ab6a0368d4a332777c (diff)
downloademacs-f619ad4ca2ce943d53589469c010e451afab97dd.tar.gz
emacs-f619ad4ca2ce943d53589469c010e451afab97dd.zip
Merge from trunk
Diffstat (limited to 'src/alloc.c')
-rw-r--r--src/alloc.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/src/alloc.c b/src/alloc.c
index 4c29ce0b4ec..81a17b5c13b 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -2301,7 +2301,6 @@ make_unibyte_string (const char *contents, EMACS_INT length)
2301 register Lisp_Object val; 2301 register Lisp_Object val;
2302 val = make_uninit_string (length); 2302 val = make_uninit_string (length);
2303 memcpy (SDATA (val), contents, length); 2303 memcpy (SDATA (val), contents, length);
2304 STRING_SET_UNIBYTE (val);
2305 return val; 2304 return val;
2306} 2305}
2307 2306
@@ -3943,7 +3942,7 @@ live_buffer_p (struct mem_node *m, void *p)
3943 must not have been killed. */ 3942 must not have been killed. */
3944 return (m->type == MEM_TYPE_BUFFER 3943 return (m->type == MEM_TYPE_BUFFER
3945 && p == m->start 3944 && p == m->start
3946 && !NILP (((struct buffer *) p)->name)); 3945 && !NILP (((struct buffer *) p)->BUFFER_INTERNAL_FIELD (name)));
3947} 3946}
3948 3947
3949#endif /* GC_MARK_STACK || defined GC_MALLOC_CHECK */ 3948#endif /* GC_MARK_STACK || defined GC_MALLOC_CHECK */
@@ -4899,8 +4898,6 @@ returns nil, because real GC can't be done. */)
4899 (void) 4898 (void)
4900{ 4899{
4901 register struct specbinding *bind; 4900 register struct specbinding *bind;
4902 struct catchtag *catch;
4903 struct handler *handler;
4904 char stack_top_variable; 4901 char stack_top_variable;
4905 register int i; 4902 register int i;
4906 int message_p; 4903 int message_p;
@@ -4929,11 +4926,11 @@ returns nil, because real GC can't be done. */)
4929 turned off in that buffer. Calling truncate_undo_list on 4926 turned off in that buffer. Calling truncate_undo_list on
4930 Qt tends to return NULL, which effectively turns undo back on. 4927 Qt tends to return NULL, which effectively turns undo back on.
4931 So don't call truncate_undo_list if undo_list is Qt. */ 4928 So don't call truncate_undo_list if undo_list is Qt. */
4932 if (! NILP (nextb->name) && ! EQ (nextb->undo_list, Qt)) 4929 if (! NILP (nextb->BUFFER_INTERNAL_FIELD (name)) && ! EQ (nextb->BUFFER_INTERNAL_FIELD (undo_list), Qt))
4933 truncate_undo_list (nextb); 4930 truncate_undo_list (nextb);
4934 4931
4935 /* Shrink buffer gaps, but skip indirect and dead buffers. */ 4932 /* Shrink buffer gaps, but skip indirect and dead buffers. */
4936 if (nextb->base_buffer == 0 && !NILP (nextb->name) 4933 if (nextb->base_buffer == 0 && !NILP (nextb->BUFFER_INTERNAL_FIELD (name))
4937 && ! nextb->text->inhibit_shrinking) 4934 && ! nextb->text->inhibit_shrinking)
4938 { 4935 {
4939 /* If a buffer's gap size is more than 10% of the buffer 4936 /* If a buffer's gap size is more than 10% of the buffer
@@ -5030,7 +5027,9 @@ returns nil, because real GC can't be done. */)
5030 mark_object (tail->var[i]); 5027 mark_object (tail->var[i]);
5031 } 5028 }
5032 mark_byte_stack (); 5029 mark_byte_stack ();
5033#endif 5030 {
5031 struct catchtag *catch;
5032 struct handler *handler;
5034 5033
5035 for (catch = catchlist; catch; catch = catch->next) 5034 for (catch = catchlist; catch; catch = catch->next)
5036 { 5035 {
@@ -5042,7 +5041,9 @@ returns nil, because real GC can't be done. */)
5042 mark_object (handler->handler); 5041 mark_object (handler->handler);
5043 mark_object (handler->var); 5042 mark_object (handler->var);
5044 } 5043 }
5044 }
5045 mark_backtrace (); 5045 mark_backtrace ();
5046#endif
5046 5047
5047#ifdef HAVE_WINDOW_SYSTEM 5048#ifdef HAVE_WINDOW_SYSTEM
5048 mark_fringe_data (); 5049 mark_fringe_data ();
@@ -5066,10 +5067,10 @@ returns nil, because real GC can't be done. */)
5066 turned off in that buffer. Calling truncate_undo_list on 5067 turned off in that buffer. Calling truncate_undo_list on
5067 Qt tends to return NULL, which effectively turns undo back on. 5068 Qt tends to return NULL, which effectively turns undo back on.
5068 So don't call truncate_undo_list if undo_list is Qt. */ 5069 So don't call truncate_undo_list if undo_list is Qt. */
5069 if (! EQ (nextb->undo_list, Qt)) 5070 if (! EQ (nextb->BUFFER_INTERNAL_FIELD (undo_list), Qt))
5070 { 5071 {
5071 Lisp_Object tail, prev; 5072 Lisp_Object tail, prev;
5072 tail = nextb->undo_list; 5073 tail = nextb->BUFFER_INTERNAL_FIELD (undo_list);
5073 prev = Qnil; 5074 prev = Qnil;
5074 while (CONSP (tail)) 5075 while (CONSP (tail))
5075 { 5076 {
@@ -5078,7 +5079,7 @@ returns nil, because real GC can't be done. */)
5078 && !XMARKER (XCAR (XCAR (tail)))->gcmarkbit) 5079 && !XMARKER (XCAR (XCAR (tail)))->gcmarkbit)
5079 { 5080 {
5080 if (NILP (prev)) 5081 if (NILP (prev))
5081 nextb->undo_list = tail = XCDR (tail); 5082 nextb->BUFFER_INTERNAL_FIELD (undo_list) = tail = XCDR (tail);
5082 else 5083 else
5083 { 5084 {
5084 tail = XCDR (tail); 5085 tail = XCDR (tail);
@@ -5094,7 +5095,7 @@ returns nil, because real GC can't be done. */)
5094 } 5095 }
5095 /* Now that we have stripped the elements that need not be in the 5096 /* Now that we have stripped the elements that need not be in the
5096 undo_list any more, we can finally mark the list. */ 5097 undo_list any more, we can finally mark the list. */
5097 mark_object (nextb->undo_list); 5098 mark_object (nextb->BUFFER_INTERNAL_FIELD (undo_list));
5098 5099
5099 nextb = nextb->next; 5100 nextb = nextb->next;
5100 } 5101 }
@@ -5652,7 +5653,7 @@ mark_buffer (Lisp_Object buf)
5652 5653
5653 /* buffer-local Lisp variables start at `undo_list', 5654 /* buffer-local Lisp variables start at `undo_list',
5654 tho only the ones from `name' on are GC'd normally. */ 5655 tho only the ones from `name' on are GC'd normally. */
5655 for (ptr = &buffer->name; 5656 for (ptr = &buffer->BUFFER_INTERNAL_FIELD (name);
5656 (char *)ptr < (char *)buffer + sizeof (struct buffer); 5657 (char *)ptr < (char *)buffer + sizeof (struct buffer);
5657 ptr++) 5658 ptr++)
5658 mark_object (*ptr); 5659 mark_object (*ptr);