[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/src/alloc.c [emacs-unicode-2]
From: |
Dave Love |
Subject: |
[Emacs-diffs] Changes to emacs/src/alloc.c [emacs-unicode-2] |
Date: |
Wed, 17 Sep 2003 15:16:29 -0400 |
Index: emacs/src/alloc.c
diff -c emacs/src/alloc.c:1.318.2.1 emacs/src/alloc.c:1.318.2.2
*** emacs/src/alloc.c:1.318.2.1 Mon Sep 8 08:48:09 2003
--- emacs/src/alloc.c Wed Sep 17 15:16:27 2003
***************
*** 552,558 ****
}
! /* Like free but block interrupt input.. */
void
xfree (block)
--- 552,558 ----
}
! /* Like free but block interrupt input. */
void
xfree (block)
***************
*** 711,717 ****
#define ABLOCKS_BASE(abase) (abase)
#else
#define ABLOCKS_BASE(abase) \
! (1 & (int) ABLOCKS_BUSY (abase) ? abase : ((void**)abase)[-1])
#endif
/* The list of free ablock. */
--- 711,717 ----
#define ABLOCKS_BASE(abase) (abase)
#else
#define ABLOCKS_BASE(abase) \
! (1 & (long) ABLOCKS_BUSY (abase) ? abase : ((void**)abase)[-1])
#endif
/* The list of free ablock. */
***************
*** 738,744 ****
if (!free_ablock)
{
! int i, aligned;
#ifdef DOUG_LEA_MALLOC
/* Prevent mmap'ing the chunk. Lisp data may not be mmap'ed
--- 738,745 ----
if (!free_ablock)
{
! int i;
! EMACS_INT aligned; /* int gets warning casting to 64-bit pointer. */
#ifdef DOUG_LEA_MALLOC
/* Prevent mmap'ing the chunk. Lisp data may not be mmap'ed
***************
*** 791,807 ****
abase->blocks[i].x.next_free = free_ablock;
free_ablock = &abase->blocks[i];
}
! ABLOCKS_BUSY (abase) = (struct ablocks *) aligned;
eassert (0 == ((EMACS_UINT)abase) % BLOCK_ALIGN);
eassert (ABLOCK_ABASE (&abase->blocks[3]) == abase); /* 3 is arbitrary
*/
eassert (ABLOCK_ABASE (&abase->blocks[0]) == abase);
eassert (ABLOCKS_BASE (abase) == base);
! eassert (aligned == (int)ABLOCKS_BUSY (abase));
}
abase = ABLOCK_ABASE (free_ablock);
! ABLOCKS_BUSY (abase) = (struct ablocks *) (2 + (int) ABLOCKS_BUSY (abase));
val = free_ablock;
free_ablock = free_ablock->x.next_free;
--- 792,808 ----
abase->blocks[i].x.next_free = free_ablock;
free_ablock = &abase->blocks[i];
}
! ABLOCKS_BUSY (abase) = (struct ablocks *) (long) aligned;
eassert (0 == ((EMACS_UINT)abase) % BLOCK_ALIGN);
eassert (ABLOCK_ABASE (&abase->blocks[3]) == abase); /* 3 is arbitrary
*/
eassert (ABLOCK_ABASE (&abase->blocks[0]) == abase);
eassert (ABLOCKS_BASE (abase) == base);
! eassert (aligned == (long) ABLOCKS_BUSY (abase));
}
abase = ABLOCK_ABASE (free_ablock);
! ABLOCKS_BUSY (abase) = (struct ablocks *) (2 + (long) ABLOCKS_BUSY (abase));
val = free_ablock;
free_ablock = free_ablock->x.next_free;
***************
*** 833,843 ****
ablock->x.next_free = free_ablock;
free_ablock = ablock;
/* Update busy count. */
! ABLOCKS_BUSY (abase) = (struct ablocks *) (-2 + (int) ABLOCKS_BUSY (abase));
! if (2 > (int) ABLOCKS_BUSY (abase))
{ /* All the blocks are free. */
! int i = 0, aligned = (int) ABLOCKS_BUSY (abase);
struct ablock **tem = &free_ablock;
struct ablock *atop = &abase->blocks[aligned ? ABLOCKS_SIZE :
ABLOCKS_SIZE - 1];
--- 834,844 ----
ablock->x.next_free = free_ablock;
free_ablock = ablock;
/* Update busy count. */
! ABLOCKS_BUSY (abase) = (struct ablocks *) (-2 + (long) ABLOCKS_BUSY
(abase));
! if (2 > (long) ABLOCKS_BUSY (abase))
{ /* All the blocks are free. */
! int i = 0, aligned = (long) ABLOCKS_BUSY (abase);
struct ablock **tem = &free_ablock;
struct ablock *atop = &abase->blocks[aligned ? ABLOCKS_SIZE :
ABLOCKS_SIZE - 1];
***************
*** 1130,1143 ****
static void
init_intervals ()
{
! interval_block
! = (struct interval_block *) lisp_malloc (sizeof *interval_block,
! MEM_TYPE_NON_LISP);
! interval_block->next = 0;
! bzero ((char *) interval_block->intervals, sizeof
interval_block->intervals);
! interval_block_index = 0;
interval_free_list = 0;
! n_interval_blocks = 1;
}
--- 1131,1140 ----
static void
init_intervals ()
{
! interval_block = NULL;
! interval_block_index = INTERVAL_BLOCK_SIZE;
interval_free_list = 0;
! n_interval_blocks = 0;
}
***************
*** 2724,2736 ****
void
init_symbol ()
{
! symbol_block = (struct symbol_block *) lisp_malloc (sizeof *symbol_block,
! MEM_TYPE_SYMBOL);
! symbol_block->next = 0;
! bzero ((char *) symbol_block->symbols, sizeof symbol_block->symbols);
! symbol_block_index = 0;
symbol_free_list = 0;
! n_symbol_blocks = 1;
}
--- 2721,2730 ----
void
init_symbol ()
{
! symbol_block = NULL;
! symbol_block_index = SYMBOL_BLOCK_SIZE;
symbol_free_list = 0;
! n_symbol_blocks = 0;
}
***************
*** 2810,2822 ****
void
init_marker ()
{
! marker_block = (struct marker_block *) lisp_malloc (sizeof *marker_block,
! MEM_TYPE_MISC);
! marker_block->next = 0;
! bzero ((char *) marker_block->markers, sizeof marker_block->markers);
! marker_block_index = 0;
marker_free_list = 0;
! n_marker_blocks = 1;
}
/* Return a newly allocated Lisp_Misc object, with no substructure. */
--- 2804,2813 ----
void
init_marker ()
{
! marker_block = NULL;
! marker_block_index = MARKER_BLOCK_SIZE;
marker_free_list = 0;
! n_marker_blocks = 0;
}
/* Return a newly allocated Lisp_Misc object, with no substructure. */
***************
*** 4351,4362 ****
/* clear_marks (); */
! /* Mark all the special slots that serve as the roots of accessibility.
!
! Usually the special slots to mark are contained in particular structures.
! Then we know no slot is marked twice because the structures don't
overlap.
! In some cases, the structures point to the slots to be marked.
! For these, we use MARKBIT to avoid double marking of the slot. */
for (i = 0; i < staticidx; i++)
mark_object (*staticvec[i]);
--- 4342,4348 ----
/* clear_marks (); */
! /* Mark all the special slots that serve as the roots of accessibility. */
for (i = 0; i < staticidx; i++)
mark_object (*staticvec[i]);
***************
*** 4369,4379 ****
register struct gcpro *tail;
for (tail = gcprolist; tail; tail = tail->next)
for (i = 0; i < tail->nvars; i++)
! if (!XMARKBIT (tail->var[i]))
! {
! mark_object (tail->var[i]);
! XMARK (tail->var[i]);
! }
}
#endif
--- 4355,4361 ----
register struct gcpro *tail;
for (tail = gcprolist; tail; tail = tail->next)
for (i = 0; i < tail->nvars; i++)
! mark_object (tail->var[i]);
}
#endif
***************
*** 4395,4415 ****
}
for (backlist = backtrace_list; backlist; backlist = backlist->next)
{
! if (!XMARKBIT (*backlist->function))
! {
! mark_object (*backlist->function);
! XMARK (*backlist->function);
! }
if (backlist->nargs == UNEVALLED || backlist->nargs == MANY)
i = 0;
else
i = backlist->nargs - 1;
for (; i >= 0; i--)
! if (!XMARKBIT (backlist->args[i]))
! {
! mark_object (backlist->args[i]);
! XMARK (backlist->args[i]);
! }
}
mark_kboards ();
--- 4377,4390 ----
}
for (backlist = backtrace_list; backlist; backlist = backlist->next)
{
! mark_object (*backlist->function);
!
if (backlist->nargs == UNEVALLED || backlist->nargs == MANY)
i = 0;
else
i = backlist->nargs - 1;
for (; i >= 0; i--)
! mark_object (backlist->args[i]);
}
mark_kboards ();
***************
*** 4475,4498 ****
|| GC_MARK_STACK == GC_USE_GCPROS_CHECK_ZOMBIES)
{
register struct gcpro *tail;
-
- for (tail = gcprolist; tail; tail = tail->next)
- for (i = 0; i < tail->nvars; i++)
- XUNMARK (tail->var[i]);
}
#endif
unmark_byte_stack ();
- for (backlist = backtrace_list; backlist; backlist = backlist->next)
- {
- XUNMARK (*backlist->function);
- if (backlist->nargs == UNEVALLED || backlist->nargs == MANY)
- i = 0;
- else
- i = backlist->nargs - 1;
- for (; i >= 0; i--)
- XUNMARK (backlist->args[i]);
- }
VECTOR_UNMARK (&buffer_defaults);
VECTOR_UNMARK (&buffer_local_symbols);
--- 4450,4459 ----
***************
*** 4677,4683 ****
int cdr_count = 0;
loop:
- XUNMARK (obj);
if (PURE_POINTER_P (XPNTR (obj)))
return;
--- 4638,4643 ----
***************
*** 5744,5746 ****
--- 5704,5709 ----
defsubr (&Sgc_status);
#endif
}
+
+ /* arch-tag: 6695ca10-e3c5-4c2c-8bc3-ed26a7dda857
+ (do not change this comment) */