comparison src/alloc.c @ 5354:22c4e67a2e69

Remove #'acons from cl.el, make the version in alloc.c visible to Lisp src/ChangeLog addition: 2011-02-09 Aidan Kehoe <kehoea@parhasard.net> * alloc.c (Facons): * alloc.c (Fobject_memory_usage): * alloc.c (syms_of_alloc): * faces.c (complex_vars_of_faces): * lisp.h: * mc-alloc.c (Fmc_alloc_memory_usage): Rename acons() to Facons(), make it visible to Lisp. Change uses of the function in C accordingly. lisp/ChangeLog addition: 2011-02-09 Aidan Kehoe <kehoea@parhasard.net> * cl.el (acons): Removed, make the implementation in alloc.c visible to Lisp instead.
author Aidan Kehoe <kehoea@parhasard.net>
date Wed, 09 Feb 2011 20:15:50 +0000
parents c096d8051f89
children 3889ef128488 00e79bbbe48f
comparison
equal deleted inserted replaced
5353:38e24b8be4ea 5354:22c4e67a2e69
1426 { 1426 {
1427 /* This cannot GC. */ 1427 /* This cannot GC. */
1428 return Fcons (obj0, Fcons (obj1, obj2)); 1428 return Fcons (obj0, Fcons (obj1, obj2));
1429 } 1429 }
1430 1430
1431 Lisp_Object 1431 DEFUN ("acons", Facons, 3, 3, 0, /*
1432 acons (Lisp_Object key, Lisp_Object value, Lisp_Object alist) 1432 Return a new alist created by prepending (KEY . VALUE) to ALIST.
1433 */
1434 (key, value, alist))
1433 { 1435 {
1434 return Fcons (Fcons (key, value), alist); 1436 return Fcons (Fcons (key, value), alist);
1435 } 1437 }
1436 1438
1437 Lisp_Object 1439 Lisp_Object
4195 stats_list = OBJECT_PROPERTY (object, memusage_stats_list); 4197 stats_list = OBJECT_PROPERTY (object, memusage_stats_list);
4196 4198
4197 xzero (object_stats); 4199 xzero (object_stats);
4198 lisp_object_storage_size (object, &object_stats); 4200 lisp_object_storage_size (object, &object_stats);
4199 4201
4200 val = acons (Qobject_actually_requested, 4202 val = Facons (Qobject_actually_requested,
4201 make_int (object_stats.was_requested), val); 4203 make_int (object_stats.was_requested), val);
4202 val = acons (Qobject_malloc_overhead, 4204 val = Facons (Qobject_malloc_overhead,
4203 make_int (object_stats.malloc_overhead), val); 4205 make_int (object_stats.malloc_overhead), val);
4204 assert (!object_stats.dynarr_overhead); 4206 assert (!object_stats.dynarr_overhead);
4205 assert (!object_stats.gap_overhead); 4207 assert (!object_stats.gap_overhead);
4206 4208
4207 if (!NILP (stats_list)) 4209 if (!NILP (stats_list))
4208 { 4210 {
4209 xzero (gustats); 4211 xzero (gustats);
4210 MAYBE_OBJECT_METH (object, memory_usage, (object, &gustats)); 4212 MAYBE_OBJECT_METH (object, memory_usage, (object, &gustats));
4211 4213
4212 val = Fcons (Qt, val); 4214 val = Fcons (Qt, val);
4213 val = acons (Qother_memory_actually_requested, 4215 val = Facons (Qother_memory_actually_requested,
4214 make_int (gustats.u.was_requested), val); 4216 make_int (gustats.u.was_requested), val);
4215 val = acons (Qother_memory_malloc_overhead, 4217 val = Facons (Qother_memory_malloc_overhead,
4216 make_int (gustats.u.malloc_overhead), val); 4218 make_int (gustats.u.malloc_overhead), val);
4217 if (gustats.u.dynarr_overhead) 4219 if (gustats.u.dynarr_overhead)
4218 val = acons (Qother_memory_dynarr_overhead, 4220 val = Facons (Qother_memory_dynarr_overhead,
4219 make_int (gustats.u.dynarr_overhead), val); 4221 make_int (gustats.u.dynarr_overhead), val);
4220 if (gustats.u.gap_overhead) 4222 if (gustats.u.gap_overhead)
4221 val = acons (Qother_memory_gap_overhead, 4223 val = Facons (Qother_memory_gap_overhead,
4222 make_int (gustats.u.gap_overhead), val); 4224 make_int (gustats.u.gap_overhead), val);
4223 val = Fcons (Qnil, val); 4225 val = Fcons (Qnil, val);
4224 4226
4225 i = 0; 4227 i = 0;
4226 { 4228 {
4227 LIST_LOOP_2 (item, stats_list) 4229 LIST_LOOP_2 (item, stats_list)
4228 { 4230 {
4229 if (NILP (item) || EQ (item, Qt)) 4231 if (NILP (item) || EQ (item, Qt))
4230 val = Fcons (item, val); 4232 val = Fcons (item, val);
4231 else 4233 else
4232 { 4234 {
4233 val = acons (item, make_int (gustats.othervals[i]), val); 4235 val = Facons (item, make_int (gustats.othervals[i]), val);
4234 i++; 4236 i++;
4235 } 4237 }
4236 } 4238 }
4237 } 4239 }
4238 } 4240 }
5699 DEFSYMBOL (Qother_memory_gap_overhead); 5701 DEFSYMBOL (Qother_memory_gap_overhead);
5700 #endif /* MEMORY_USAGE_STATS */ 5702 #endif /* MEMORY_USAGE_STATS */
5701 5703
5702 DEFSUBR (Fcons); 5704 DEFSUBR (Fcons);
5703 DEFSUBR (Flist); 5705 DEFSUBR (Flist);
5706 DEFSUBR (Facons);
5704 DEFSUBR (Fvector); 5707 DEFSUBR (Fvector);
5705 DEFSUBR (Fbit_vector); 5708 DEFSUBR (Fbit_vector);
5706 DEFSUBR (Fmake_byte_code); 5709 DEFSUBR (Fmake_byte_code);
5707 DEFSUBR (Fmake_list); 5710 DEFSUBR (Fmake_list);
5708 DEFSUBR (Fmake_vector); 5711 DEFSUBR (Fmake_vector);