aboutsummaryrefslogtreecommitdiffstats
path: root/src/alloc.c
diff options
context:
space:
mode:
authorNickolas Lloyd2017-02-01 22:31:55 -0500
committerNickolas Lloyd2017-02-01 22:31:55 -0500
commit9a15b5509abb49a11c97c1101ad216f4ef258368 (patch)
tree7311337d92833cb8f233eaa696a967a15a306a80 /src/alloc.c
parent5d8f2548ceaa5a0b33c08a39f1d6c11071ec63aa (diff)
parent70d36dda26465b43c1a63e8e13153e070af86456 (diff)
downloademacs-nick.lloyd-bytecode-jit.tar.gz
emacs-nick.lloyd-bytecode-jit.zip
Merge branch 'master' into nick.lloyd-bytecode-jitnick.lloyd-bytecode-jit
Diffstat (limited to 'src/alloc.c')
-rw-r--r--src/alloc.c26
1 files changed, 11 insertions, 15 deletions
diff --git a/src/alloc.c b/src/alloc.c
index 8c9b1167fb0..a2302a6f462 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -2884,7 +2884,7 @@ DEFUN ("make-list", Fmake_list, Smake_list, 2, 2, 0,
2884 for (EMACS_INT size = XFASTINT (length); 0 < size; size--) 2884 for (EMACS_INT size = XFASTINT (length); 0 < size; size--)
2885 { 2885 {
2886 val = Fcons (init, val); 2886 val = Fcons (init, val);
2887 maybe_quit (); 2887 rarely_quit (size);
2888 } 2888 }
2889 2889
2890 return val; 2890 return val;
@@ -5452,7 +5452,8 @@ make_pure_vector (ptrdiff_t len)
5452/* Copy all contents and parameters of TABLE to a new table allocated 5452/* Copy all contents and parameters of TABLE to a new table allocated
5453 from pure space, return the purified table. */ 5453 from pure space, return the purified table. */
5454static struct Lisp_Hash_Table * 5454static struct Lisp_Hash_Table *
5455purecopy_hash_table (struct Lisp_Hash_Table *table) { 5455purecopy_hash_table (struct Lisp_Hash_Table *table)
5456{
5456 eassert (NILP (table->weak)); 5457 eassert (NILP (table->weak));
5457 eassert (!NILP (table->pure)); 5458 eassert (!NILP (table->pure));
5458 5459
@@ -5495,14 +5496,12 @@ Does not copy symbols. Copies strings without text properties. */)
5495 return purecopy (obj); 5496 return purecopy (obj);
5496} 5497}
5497 5498
5498struct pinned_object 5499/* Pinned objects are marked before every GC cycle. */
5500static struct pinned_object
5499{ 5501{
5500 Lisp_Object object; 5502 Lisp_Object object;
5501 struct pinned_object *next; 5503 struct pinned_object *next;
5502}; 5504} *pinned_objects;
5503
5504/* Pinned objects are marked before every GC cycle. */
5505static struct pinned_object *pinned_objects;
5506 5505
5507static Lisp_Object 5506static Lisp_Object
5508purecopy (Lisp_Object obj) 5507purecopy (Lisp_Object obj)
@@ -5534,13 +5533,13 @@ purecopy (Lisp_Object obj)
5534 else if (HASH_TABLE_P (obj)) 5533 else if (HASH_TABLE_P (obj))
5535 { 5534 {
5536 struct Lisp_Hash_Table *table = XHASH_TABLE (obj); 5535 struct Lisp_Hash_Table *table = XHASH_TABLE (obj);
5537 /* We cannot purify hash tables which haven't been defined with 5536 /* Do not purify hash tables which haven't been defined with
5538 :purecopy as non-nil or are weak - they aren't guaranteed to 5537 :purecopy as non-nil or are weak - they aren't guaranteed to
5539 not change. */ 5538 not change. */
5540 if (!NILP (table->weak) || NILP (table->pure)) 5539 if (!NILP (table->weak) || NILP (table->pure))
5541 { 5540 {
5542 /* Instead, the hash table is added to the list of pinned objects, 5541 /* Instead, add the hash table to the list of pinned objects,
5543 and is marked before GC. */ 5542 so that it will be marked during GC. */
5544 struct pinned_object *o = xmalloc (sizeof *o); 5543 struct pinned_object *o = xmalloc (sizeof *o);
5545 o->object = obj; 5544 o->object = obj;
5546 o->next = pinned_objects; 5545 o->next = pinned_objects;
@@ -5770,11 +5769,8 @@ compact_undo_list (Lisp_Object list)
5770static void 5769static void
5771mark_pinned_objects (void) 5770mark_pinned_objects (void)
5772{ 5771{
5773 struct pinned_object *pobj; 5772 for (struct pinned_object *pobj = pinned_objects; pobj; pobj = pobj->next)
5774 for (pobj = pinned_objects; pobj; pobj = pobj->next) 5773 mark_object (pobj->object);
5775 {
5776 mark_object (pobj->object);
5777 }
5778} 5774}
5779 5775
5780static void 5776static void