aboutsummaryrefslogtreecommitdiffstats
path: root/src/lisp.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/lisp.h')
-rw-r--r--src/lisp.h364
1 files changed, 292 insertions, 72 deletions
diff --git a/src/lisp.h b/src/lisp.h
index 419176d06c8..897addc90c1 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -1,6 +1,7 @@
1/* Fundamental definitions for GNU Emacs Lisp interpreter. 1/* Fundamental definitions for GNU Emacs Lisp interpreter.
2 2
3Copyright (C) 1985-1987, 1993-1995, 1997-2012 Free Software Foundation, Inc. 3Copyright (C) 1985-1987, 1993-1995, 1997-2013 Free Software Foundation,
4Inc.
4 5
5This file is part of GNU Emacs. 6This file is part of GNU Emacs.
6 7
@@ -226,7 +227,7 @@ enum enum_USE_LSB_TAG { USE_LSB_TAG = 0 };
226 227
227/* Lisp integers use 2 tags, to give them one extra bit, thus 228/* Lisp integers use 2 tags, to give them one extra bit, thus
228 extending their range from, e.g., -2^28..2^28-1 to -2^29..2^29-1. */ 229 extending their range from, e.g., -2^28..2^28-1 to -2^29..2^29-1. */
229static EMACS_INT const INTMASK = EMACS_INT_MAX >> (INTTYPEBITS - 1); 230#define INTMASK (EMACS_INT_MAX >> (INTTYPEBITS - 1))
230#define case_Lisp_Int case Lisp_Int0: case Lisp_Int1 231#define case_Lisp_Int case Lisp_Int0: case Lisp_Int1
231#define LISP_INT_TAG_P(x) (((x) & ~Lisp_Int1) == 0) 232#define LISP_INT_TAG_P(x) (((x) & ~Lisp_Int1) == 0)
232 233
@@ -325,6 +326,10 @@ enum Lisp_Fwd_Type
325 members that are accessible only from C. A Lisp_Misc object is a 326 members that are accessible only from C. A Lisp_Misc object is a
326 wrapper for a C struct that can contain anything you like. 327 wrapper for a C struct that can contain anything you like.
327 328
329 Explicit freeing is discouraged for Lisp objects in general. But if
330 you really need to exploit this, use Lisp_Misc (check free_misc in
331 alloc.c to see why). There is no way to free a vectorlike object.
332
328 To add a new pseudovector type, extend the pvec_type enumeration; 333 To add a new pseudovector type, extend the pvec_type enumeration;
329 to add a new Lisp_Misc, extend the Lisp_Misc_Type enumeration. 334 to add a new Lisp_Misc, extend the Lisp_Misc_Type enumeration.
330 335
@@ -334,6 +339,10 @@ enum Lisp_Fwd_Type
334 enumeration and a 1-bit GC markbit) and make sure the overall size 339 enumeration and a 1-bit GC markbit) and make sure the overall size
335 of the union is not increased by your addition. 340 of the union is not increased by your addition.
336 341
342 For a new pseudovector, it's highly desirable to limit the size
343 of your data type by VBLOCK_BYTES_MAX bytes (defined in alloc.c).
344 Otherwise you will need to change sweep_vectors (also in alloc.c).
345
337 Then you will need to add switch branches in print.c (in 346 Then you will need to add switch branches in print.c (in
338 print_object, to print your object, and possibly also in 347 print_object, to print your object, and possibly also in
339 print_preprocess) and to alloc.c, to mark your object (in 348 print_preprocess) and to alloc.c, to mark your object (in
@@ -496,13 +505,9 @@ static EMACS_INT const VALMASK
496 (XIL ((EMACS_INT) ((EMACS_UINT) (type) << VALBITS) \ 505 (XIL ((EMACS_INT) ((EMACS_UINT) (type) << VALBITS) \
497 + ((intptr_t) (ptr) & VALMASK))) 506 + ((intptr_t) (ptr) & VALMASK)))
498 507
499#if DATA_SEG_BITS
500/* DATA_SEG_BITS forces extra bits to be or'd in with any pointers 508/* DATA_SEG_BITS forces extra bits to be or'd in with any pointers
501 which were stored in a Lisp_Object. */ 509 which were stored in a Lisp_Object. */
502#define XPNTR(a) ((uintptr_t) ((XLI (a) & VALMASK)) | DATA_SEG_BITS)) 510#define XPNTR(a) ((uintptr_t) ((XLI (a) & VALMASK) | DATA_SEG_BITS))
503#else
504#define XPNTR(a) ((uintptr_t) (XLI (a) & VALMASK))
505#endif
506 511
507#endif /* not USE_LSB_TAG */ 512#endif /* not USE_LSB_TAG */
508 513
@@ -538,7 +543,7 @@ static EMACS_INT const VALMASK
538 type or if I is a NaN. */ 543 type or if I is a NaN. */
539 544
540#define FIXNUM_OVERFLOW_P(i) \ 545#define FIXNUM_OVERFLOW_P(i) \
541 (! ((0 <= (i) || MOST_NEGATIVE_FIXNUM <= (i)) && (i) <= MOST_POSITIVE_FIXNUM)) 546 (! (((i) >= 0 || (i) >= MOST_NEGATIVE_FIXNUM) && (i) <= MOST_POSITIVE_FIXNUM))
542 547
543LISP_INLINE ptrdiff_t 548LISP_INLINE ptrdiff_t
544clip_to_bounds (ptrdiff_t lower, EMACS_INT num, ptrdiff_t upper) 549clip_to_bounds (ptrdiff_t lower, EMACS_INT num, ptrdiff_t upper)
@@ -546,6 +551,12 @@ clip_to_bounds (ptrdiff_t lower, EMACS_INT num, ptrdiff_t upper)
546 return num < lower ? lower : num <= upper ? num : upper; 551 return num < lower ? lower : num <= upper ? num : upper;
547} 552}
548 553
554
555/* Forward declarations. */
556
557LISP_INLINE bool SAVE_VALUEP (Lisp_Object);
558LISP_INLINE struct Lisp_Save_Value *XSAVE_VALUE (Lisp_Object);
559
549/* Extract a value or address from a Lisp_Object. */ 560/* Extract a value or address from a Lisp_Object. */
550 561
551#define XCONS(a) (eassert (CONSP (a)), \ 562#define XCONS(a) (eassert (CONSP (a)), \
@@ -566,7 +577,6 @@ clip_to_bounds (ptrdiff_t lower, EMACS_INT num, ptrdiff_t upper)
566#define XMISCTYPE(a) (XMISCANY (a)->type) 577#define XMISCTYPE(a) (XMISCANY (a)->type)
567#define XMARKER(a) (eassert (MARKERP (a)), &(XMISC (a)->u_marker)) 578#define XMARKER(a) (eassert (MARKERP (a)), &(XMISC (a)->u_marker))
568#define XOVERLAY(a) (eassert (OVERLAYP (a)), &(XMISC (a)->u_overlay)) 579#define XOVERLAY(a) (eassert (OVERLAYP (a)), &(XMISC (a)->u_overlay))
569#define XSAVE_VALUE(a) (eassert (SAVE_VALUEP (a)), &(XMISC (a)->u_save_value))
570 580
571/* Forwarding object types. */ 581/* Forwarding object types. */
572 582
@@ -776,13 +786,10 @@ extern ptrdiff_t string_bytes (struct Lisp_String *);
776 would expose alloc.c internal details that we'd rather keep 786 would expose alloc.c internal details that we'd rather keep
777 private. 787 private.
778 788
779 This is a macro for use in static initializers, and a constant for 789 This is a macro for use in static initializers. The cast to
780 visibility to GDB. The cast to ptrdiff_t ensures that 790 ptrdiff_t ensures that the macro is signed. */
781 the macro is signed. */
782static ptrdiff_t const STRING_BYTES_BOUND =
783#define STRING_BYTES_BOUND \ 791#define STRING_BYTES_BOUND \
784 ((ptrdiff_t) min (MOST_POSITIVE_FIXNUM, min (SIZE_MAX, PTRDIFF_MAX) - 1)) 792 ((ptrdiff_t) min (MOST_POSITIVE_FIXNUM, min (SIZE_MAX, PTRDIFF_MAX) - 1))
785 STRING_BYTES_BOUND;
786 793
787/* Mark STR as a unibyte string. */ 794/* Mark STR as a unibyte string. */
788#define STRING_SET_UNIBYTE(STR) \ 795#define STRING_SET_UNIBYTE(STR) \
@@ -1295,6 +1302,14 @@ sxhash_combine (EMACS_UINT x, EMACS_UINT y)
1295 return (x << 4) + (x >> (BITS_PER_EMACS_INT - 4)) + y; 1302 return (x << 4) + (x >> (BITS_PER_EMACS_INT - 4)) + y;
1296} 1303}
1297 1304
1305/* Hash X, returning a value that fits into a fixnum. */
1306
1307LISP_INLINE EMACS_UINT
1308SXHASH_REDUCE (EMACS_UINT x)
1309{
1310 return (x ^ x >> (BITS_PER_EMACS_INT - FIXNUM_BITS)) & INTMASK;
1311}
1312
1298/* These structures are used for various misc types. */ 1313/* These structures are used for various misc types. */
1299 1314
1300struct Lisp_Misc_Any /* Supertype of all Misc types. */ 1315struct Lisp_Misc_Any /* Supertype of all Misc types. */
@@ -1369,20 +1384,155 @@ struct Lisp_Overlay
1369 Lisp_Object plist; 1384 Lisp_Object plist;
1370 }; 1385 };
1371 1386
1372/* Hold a C pointer for later use. 1387/* Types of data which may be saved in a Lisp_Save_Value. */
1373 This type of object is used in the arg to record_unwind_protect. */ 1388
1389enum
1390 {
1391 SAVE_UNUSED,
1392 SAVE_INTEGER,
1393 SAVE_POINTER,
1394 SAVE_OBJECT
1395 };
1396
1397/* Number of bits needed to store one of the above values. */
1398enum { SAVE_SLOT_BITS = 2 };
1399
1400/* Number of slots in a save value where save_type is nonzero. */
1401enum { SAVE_VALUE_SLOTS = 4 };
1402
1403/* Bit-width and values for struct Lisp_Save_Value's save_type member. */
1404
1405enum { SAVE_TYPE_BITS = SAVE_VALUE_SLOTS * SAVE_SLOT_BITS + 1 };
1406
1407enum Lisp_Save_Type
1408 {
1409 SAVE_TYPE_INT_INT = SAVE_INTEGER + (SAVE_INTEGER << SAVE_SLOT_BITS),
1410 SAVE_TYPE_INT_INT_INT
1411 = (SAVE_INTEGER + (SAVE_TYPE_INT_INT << SAVE_SLOT_BITS)),
1412 SAVE_TYPE_OBJ_OBJ = SAVE_OBJECT + (SAVE_OBJECT << SAVE_SLOT_BITS),
1413 SAVE_TYPE_OBJ_OBJ_OBJ = SAVE_OBJECT + (SAVE_TYPE_OBJ_OBJ << SAVE_SLOT_BITS),
1414 SAVE_TYPE_OBJ_OBJ_OBJ_OBJ
1415 = SAVE_OBJECT + (SAVE_TYPE_OBJ_OBJ_OBJ << SAVE_SLOT_BITS),
1416 SAVE_TYPE_PTR_INT = SAVE_POINTER + (SAVE_INTEGER << SAVE_SLOT_BITS),
1417 SAVE_TYPE_PTR_OBJ = SAVE_POINTER + (SAVE_OBJECT << SAVE_SLOT_BITS),
1418 SAVE_TYPE_PTR_PTR = SAVE_POINTER + (SAVE_POINTER << SAVE_SLOT_BITS),
1419 SAVE_TYPE_PTR_PTR_OBJ
1420 = SAVE_POINTER + (SAVE_TYPE_PTR_OBJ << SAVE_SLOT_BITS),
1421
1422 /* This has an extra bit indicating it's raw memory. */
1423 SAVE_TYPE_MEMORY = SAVE_TYPE_PTR_INT + (1 << (SAVE_TYPE_BITS - 1))
1424 };
1425
1426/* Special object used to hold a different values for later use.
1427
1428 This is mostly used to package C integers and pointers to call
1429 record_unwind_protect. Typical task is to pass just one C pointer
1430 to unwind function. You should pack pointer with make_save_pointer
1431 and then get it back with XSAVE_POINTER, e.g.:
1432
1433 ...
1434 struct my_data *md = get_my_data ();
1435 record_unwind_protect (my_unwind, make_save_pointer (md));
1436 ...
1437
1438 Lisp_Object my_unwind (Lisp_Object arg)
1439 {
1440 struct my_data *md = XSAVE_POINTER (arg, 0);
1441 ...
1442 }
1443
1444 If yon need to pass more than just one C pointer, you should
1445 use make_save_value. This function allows you to pack up to
1446 SAVE_VALUE_SLOTS integers, pointers or Lisp_Objects and
1447 conveniently get them back with XSAVE_POINTER, XSAVE_INTEGER and
1448 XSAVE_OBJECT macros:
1449
1450 ...
1451 struct my_data *md = get_my_data ();
1452 Lisp_Object my_object = get_my_object ();
1453 record_unwind_protect
1454 (my_unwind, make_save_value (SAVE_TYPE_PTR_OBJ, md, my_object));
1455 ...
1456
1457 Lisp_Object my_unwind (Lisp_Object arg)
1458 {
1459 struct my_data *md = XSAVE_POINTER (arg, 0);
1460 Lisp_Object my_object = XSAVE_OBJECT (arg, 1);
1461 ...
1462 }
1463
1464 If ENABLE_CHECKING is in effect, XSAVE_xxx macros do type checking of the
1465 saved objects and raise eassert if type of the saved object doesn't match
1466 the type which is extracted. In the example above, XSAVE_INTEGER (arg, 2)
1467 or XSAVE_OBJECT (arg, 0) are wrong because nothing was saved in slot 2 and
1468 Lisp_Object was saved in slot 1 of ARG. */
1469
1374struct Lisp_Save_Value 1470struct Lisp_Save_Value
1375 { 1471 {
1376 ENUM_BF (Lisp_Misc_Type) type : 16; /* = Lisp_Misc_Save_Value */ 1472 ENUM_BF (Lisp_Misc_Type) type : 16; /* = Lisp_Misc_Save_Value */
1377 unsigned gcmarkbit : 1; 1473 unsigned gcmarkbit : 1;
1378 int spacer : 14; 1474 int spacer : 32 - (16 + 1 + SAVE_TYPE_BITS);
1379 /* If DOGC is set, POINTER is the address of a memory 1475
1380 area containing INTEGER potential Lisp_Objects. */ 1476 /* DATA[N] may hold up to SAVE_VALUE_SLOTS entries. The type of
1381 unsigned int dogc : 1; 1477 V's Ith entry is given by save_type (V, I). E.g., if save_type
1382 void *pointer; 1478 (V, 3) == SAVE_INTEGER, V->data[3].integer is in use.
1383 ptrdiff_t integer; 1479
1480 If SAVE_TYPE == SAVE_TYPE_MEMORY, DATA[0].pointer is the address of
1481 a memory area containing DATA[1].integer potential Lisp_Objects. */
1482 ENUM_BF (Lisp_Save_Type) save_type : SAVE_TYPE_BITS;
1483 union {
1484 void *pointer;
1485 ptrdiff_t integer;
1486 Lisp_Object object;
1487 } data[SAVE_VALUE_SLOTS];
1384 }; 1488 };
1385 1489
1490/* Return the type of V's Nth saved value. */
1491LISP_INLINE int
1492save_type (struct Lisp_Save_Value *v, int n)
1493{
1494 eassert (0 <= n && n < SAVE_VALUE_SLOTS);
1495 return (v->save_type >> (SAVE_SLOT_BITS * n) & ((1 << SAVE_SLOT_BITS) - 1));
1496}
1497
1498/* Get and set the Nth saved pointer. */
1499
1500LISP_INLINE void *
1501XSAVE_POINTER (Lisp_Object obj, int n)
1502{
1503 eassert (save_type (XSAVE_VALUE (obj), n) == SAVE_POINTER);
1504 return XSAVE_VALUE (obj)->data[n].pointer;;
1505}
1506LISP_INLINE void
1507set_save_pointer (Lisp_Object obj, int n, void *val)
1508{
1509 eassert (save_type (XSAVE_VALUE (obj), n) == SAVE_POINTER);
1510 XSAVE_VALUE (obj)->data[n].pointer = val;
1511}
1512
1513/* Likewise for the saved integer. */
1514
1515LISP_INLINE ptrdiff_t
1516XSAVE_INTEGER (Lisp_Object obj, int n)
1517{
1518 eassert (save_type (XSAVE_VALUE (obj), n) == SAVE_INTEGER);
1519 return XSAVE_VALUE (obj)->data[n].integer;
1520}
1521LISP_INLINE void
1522set_save_integer (Lisp_Object obj, int n, ptrdiff_t val)
1523{
1524 eassert (save_type (XSAVE_VALUE (obj), n) == SAVE_INTEGER);
1525 XSAVE_VALUE (obj)->data[n].integer = val;
1526}
1527
1528/* Extract Nth saved object. */
1529
1530LISP_INLINE Lisp_Object
1531XSAVE_OBJECT (Lisp_Object obj, int n)
1532{
1533 eassert (save_type (XSAVE_VALUE (obj), n) == SAVE_OBJECT);
1534 return XSAVE_VALUE (obj)->data[n].object;
1535}
1386 1536
1387/* A miscellaneous object, when it's on the free list. */ 1537/* A miscellaneous object, when it's on the free list. */
1388struct Lisp_Free 1538struct Lisp_Free
@@ -1405,6 +1555,13 @@ union Lisp_Misc
1405 struct Lisp_Save_Value u_save_value; 1555 struct Lisp_Save_Value u_save_value;
1406 }; 1556 };
1407 1557
1558LISP_INLINE struct Lisp_Save_Value *
1559XSAVE_VALUE (Lisp_Object a)
1560{
1561 eassert (SAVE_VALUEP (a));
1562 return & XMISC (a)->u_save_value;
1563}
1564
1408/* Forwarding pointer to an int variable. 1565/* Forwarding pointer to an int variable.
1409 This is allowed only in the value cell of a symbol, 1566 This is allowed only in the value cell of a symbol,
1410 and it means that the symbol's value really lives in the 1567 and it means that the symbol's value really lives in the
@@ -1441,7 +1598,8 @@ struct Lisp_Buffer_Objfwd
1441 { 1598 {
1442 enum Lisp_Fwd_Type type; /* = Lisp_Fwd_Buffer_Obj */ 1599 enum Lisp_Fwd_Type type; /* = Lisp_Fwd_Buffer_Obj */
1443 int offset; 1600 int offset;
1444 Lisp_Object slottype; /* Qnil, Lisp_Int, Lisp_Symbol, or Lisp_String. */ 1601 /* One of Qnil, Qintegerp, Qsymbolp, Qstringp, Qfloatp or Qnumberp. */
1602 Lisp_Object predicate;
1445 }; 1603 };
1446 1604
1447/* struct Lisp_Buffer_Local_Value is used in a symbol value cell when 1605/* struct Lisp_Buffer_Local_Value is used in a symbol value cell when
@@ -1644,7 +1802,6 @@ typedef struct {
1644 int mouse_face_beg_x, mouse_face_beg_y; 1802 int mouse_face_beg_x, mouse_face_beg_y;
1645 int mouse_face_end_row, mouse_face_end_col; 1803 int mouse_face_end_row, mouse_face_end_col;
1646 int mouse_face_end_x, mouse_face_end_y; 1804 int mouse_face_end_x, mouse_face_end_y;
1647 int mouse_face_past_end;
1648 Lisp_Object mouse_face_window; 1805 Lisp_Object mouse_face_window;
1649 int mouse_face_face_id; 1806 int mouse_face_face_id;
1650 Lisp_Object mouse_face_overlay; 1807 Lisp_Object mouse_face_overlay;
@@ -1654,13 +1811,15 @@ typedef struct {
1654 struct frame *mouse_face_mouse_frame; 1811 struct frame *mouse_face_mouse_frame;
1655 int mouse_face_mouse_x, mouse_face_mouse_y; 1812 int mouse_face_mouse_x, mouse_face_mouse_y;
1656 1813
1814 /* Nonzero if part of the text currently shown in
1815 its mouse-face is beyond the window end. */
1816 unsigned mouse_face_past_end : 1;
1817
1657 /* Nonzero means defer mouse-motion highlighting. */ 1818 /* Nonzero means defer mouse-motion highlighting. */
1658 int mouse_face_defer; 1819 unsigned mouse_face_defer : 1;
1659 1820
1660 /* Nonzero means that the mouse highlight should not be shown. */ 1821 /* Nonzero means that the mouse highlight should not be shown. */
1661 int mouse_face_hidden; 1822 unsigned mouse_face_hidden : 1;
1662
1663 int mouse_face_image_state;
1664} Mouse_HLInfo; 1823} Mouse_HLInfo;
1665 1824
1666/* Data type checking. */ 1825/* Data type checking. */
@@ -1688,7 +1847,12 @@ typedef struct {
1688#define VECTORP(x) (VECTORLIKEP (x) && !(ASIZE (x) & PSEUDOVECTOR_FLAG)) 1847#define VECTORP(x) (VECTORLIKEP (x) && !(ASIZE (x) & PSEUDOVECTOR_FLAG))
1689#define OVERLAYP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Overlay) 1848#define OVERLAYP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Overlay)
1690#define MARKERP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Marker) 1849#define MARKERP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Marker)
1691#define SAVE_VALUEP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Save_Value) 1850
1851LISP_INLINE bool
1852SAVE_VALUEP (Lisp_Object x)
1853{
1854 return MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Save_Value;
1855}
1692 1856
1693#define AUTOLOADP(x) (CONSP (x) && EQ (Qautoload, XCAR (x))) 1857#define AUTOLOADP(x) (CONSP (x) && EQ (Qautoload, XCAR (x)))
1694 1858
@@ -2206,8 +2370,12 @@ struct gcpro
2206 2 Mark the stack, and check that everything GCPRO'd is 2370 2 Mark the stack, and check that everything GCPRO'd is
2207 marked. 2371 marked.
2208 3 Mark using GCPRO's, mark stack last, and count how many 2372 3 Mark using GCPRO's, mark stack last, and count how many
2209 dead objects are kept alive. */ 2373 dead objects are kept alive.
2210 2374
2375 Formerly, method 0 was used. Currently, method 1 is used unless
2376 otherwise specified by hand when building, e.g.,
2377 "make CPPFLAGS='-DGC_MARK_STACK=GC_USE_GCPROS_AS_BEFORE'".
2378 Methods 2 and 3 are present mainly to debug the transition from 0 to 1. */
2211 2379
2212#define GC_USE_GCPROS_AS_BEFORE 0 2380#define GC_USE_GCPROS_AS_BEFORE 0
2213#define GC_MAKE_GCPROS_NOOPS 1 2381#define GC_MAKE_GCPROS_NOOPS 1
@@ -2397,7 +2565,7 @@ gc_aset (Lisp_Object array, ptrdiff_t idx, Lisp_Object val)
2397LISP_INLINE void 2565LISP_INLINE void
2398vcopy (Lisp_Object v, ptrdiff_t offset, Lisp_Object *args, ptrdiff_t count) 2566vcopy (Lisp_Object v, ptrdiff_t offset, Lisp_Object *args, ptrdiff_t count)
2399{ 2567{
2400 eassert (0 <= offset && 0 <= count && offset + count <= ASIZE (v)); 2568 eassert (offset >= 0 && count >= 0 && offset + count <= ASIZE (v));
2401 memcpy (XVECTOR (v)->contents + offset, args, count * sizeof *args); 2569 memcpy (XVECTOR (v)->contents + offset, args, count * sizeof *args);
2402} 2570}
2403 2571
@@ -2764,10 +2932,10 @@ extern void syms_of_image (void);
2764 2932
2765/* Defined in insdel.c. */ 2933/* Defined in insdel.c. */
2766extern Lisp_Object Qinhibit_modification_hooks; 2934extern Lisp_Object Qinhibit_modification_hooks;
2767extern void move_gap (ptrdiff_t);
2768extern void move_gap_both (ptrdiff_t, ptrdiff_t); 2935extern void move_gap_both (ptrdiff_t, ptrdiff_t);
2769extern _Noreturn void buffer_overflow (void); 2936extern _Noreturn void buffer_overflow (void);
2770extern void make_gap (ptrdiff_t); 2937extern void make_gap (ptrdiff_t);
2938extern void make_gap_1 (struct buffer *, ptrdiff_t);
2771extern ptrdiff_t copy_text (const unsigned char *, unsigned char *, 2939extern ptrdiff_t copy_text (const unsigned char *, unsigned char *,
2772 ptrdiff_t, bool, bool); 2940 ptrdiff_t, bool, bool);
2773extern int count_combining_before (const unsigned char *, 2941extern int count_combining_before (const unsigned char *,
@@ -2776,10 +2944,9 @@ extern int count_combining_after (const unsigned char *,
2776 ptrdiff_t, ptrdiff_t, ptrdiff_t); 2944 ptrdiff_t, ptrdiff_t, ptrdiff_t);
2777extern void insert (const char *, ptrdiff_t); 2945extern void insert (const char *, ptrdiff_t);
2778extern void insert_and_inherit (const char *, ptrdiff_t); 2946extern void insert_and_inherit (const char *, ptrdiff_t);
2779extern void insert_1 (const char *, ptrdiff_t, bool, bool, bool);
2780extern void insert_1_both (const char *, ptrdiff_t, ptrdiff_t, 2947extern void insert_1_both (const char *, ptrdiff_t, ptrdiff_t,
2781 bool, bool, bool); 2948 bool, bool, bool);
2782extern void insert_from_gap (ptrdiff_t, ptrdiff_t); 2949extern void insert_from_gap (ptrdiff_t, ptrdiff_t, bool text_at_gap_tail);
2783extern void insert_from_string (Lisp_Object, ptrdiff_t, ptrdiff_t, 2950extern void insert_from_string (Lisp_Object, ptrdiff_t, ptrdiff_t,
2784 ptrdiff_t, ptrdiff_t, bool); 2951 ptrdiff_t, ptrdiff_t, bool);
2785extern void insert_from_buffer (struct buffer *, ptrdiff_t, ptrdiff_t, bool); 2952extern void insert_from_buffer (struct buffer *, ptrdiff_t, ptrdiff_t, bool);
@@ -2796,7 +2963,7 @@ extern void del_range_byte (ptrdiff_t, ptrdiff_t, bool);
2796extern void del_range_both (ptrdiff_t, ptrdiff_t, ptrdiff_t, ptrdiff_t, bool); 2963extern void del_range_both (ptrdiff_t, ptrdiff_t, ptrdiff_t, ptrdiff_t, bool);
2797extern Lisp_Object del_range_2 (ptrdiff_t, ptrdiff_t, 2964extern Lisp_Object del_range_2 (ptrdiff_t, ptrdiff_t,
2798 ptrdiff_t, ptrdiff_t, bool); 2965 ptrdiff_t, ptrdiff_t, bool);
2799extern void modify_region (struct buffer *, ptrdiff_t, ptrdiff_t, bool); 2966extern void modify_region_1 (ptrdiff_t, ptrdiff_t, bool);
2800extern void prepare_to_modify_buffer (ptrdiff_t, ptrdiff_t, ptrdiff_t *); 2967extern void prepare_to_modify_buffer (ptrdiff_t, ptrdiff_t, ptrdiff_t *);
2801extern void signal_after_change (ptrdiff_t, ptrdiff_t, ptrdiff_t); 2968extern void signal_after_change (ptrdiff_t, ptrdiff_t, ptrdiff_t);
2802extern void adjust_after_insert (ptrdiff_t, ptrdiff_t, ptrdiff_t, 2969extern void adjust_after_insert (ptrdiff_t, ptrdiff_t, ptrdiff_t,
@@ -2850,11 +3017,9 @@ extern void clear_message (int, int);
2850extern void message (const char *, ...) ATTRIBUTE_FORMAT_PRINTF (1, 2); 3017extern void message (const char *, ...) ATTRIBUTE_FORMAT_PRINTF (1, 2);
2851extern void message1 (const char *); 3018extern void message1 (const char *);
2852extern void message1_nolog (const char *); 3019extern void message1_nolog (const char *);
2853extern void message2 (const char *, ptrdiff_t, int); 3020extern void message3 (Lisp_Object);
2854extern void message2_nolog (const char *, ptrdiff_t, int); 3021extern void message3_nolog (Lisp_Object);
2855extern void message3 (Lisp_Object, ptrdiff_t, int); 3022extern void message_dolog (const char *, ptrdiff_t, bool, bool);
2856extern void message3_nolog (Lisp_Object, ptrdiff_t, int);
2857extern void message_dolog (const char *, ptrdiff_t, int, int);
2858extern void message_with_string (const char *, Lisp_Object, int); 3023extern void message_with_string (const char *, Lisp_Object, int);
2859extern void message_log_maybe_newline (void); 3024extern void message_log_maybe_newline (void);
2860extern void update_echo_area (void); 3025extern void update_echo_area (void);
@@ -2878,6 +3043,7 @@ extern void memory_warnings (void *, void (*warnfun) (const char *));
2878 3043
2879/* Defined in alloc.c. */ 3044/* Defined in alloc.c. */
2880extern void check_pure_size (void); 3045extern void check_pure_size (void);
3046extern void free_misc (Lisp_Object);
2881extern void allocate_string_data (struct Lisp_String *, EMACS_INT, EMACS_INT); 3047extern void allocate_string_data (struct Lisp_String *, EMACS_INT, EMACS_INT);
2882extern void malloc_warning (const char *); 3048extern void malloc_warning (const char *);
2883extern _Noreturn void memory_full (size_t); 3049extern _Noreturn void memory_full (size_t);
@@ -2901,6 +3067,28 @@ extern Lisp_Object list5 (Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object,
2901 Lisp_Object); 3067 Lisp_Object);
2902enum constype {CONSTYPE_HEAP, CONSTYPE_PURE}; 3068enum constype {CONSTYPE_HEAP, CONSTYPE_PURE};
2903extern Lisp_Object listn (enum constype, ptrdiff_t, Lisp_Object, ...); 3069extern Lisp_Object listn (enum constype, ptrdiff_t, Lisp_Object, ...);
3070
3071/* Build a frequently used 2/3/4-integer lists. */
3072
3073LISP_INLINE Lisp_Object
3074list2i (EMACS_INT x, EMACS_INT y)
3075{
3076 return list2 (make_number (x), make_number (y));
3077}
3078
3079LISP_INLINE Lisp_Object
3080list3i (EMACS_INT x, EMACS_INT y, EMACS_INT w)
3081{
3082 return list3 (make_number (x), make_number (y), make_number (w));
3083}
3084
3085LISP_INLINE Lisp_Object
3086list4i (EMACS_INT x, EMACS_INT y, EMACS_INT w, EMACS_INT h)
3087{
3088 return list4 (make_number (x), make_number (y),
3089 make_number (w), make_number (h));
3090}
3091
2904extern _Noreturn void string_overflow (void); 3092extern _Noreturn void string_overflow (void);
2905extern Lisp_Object make_string (const char *, ptrdiff_t); 3093extern Lisp_Object make_string (const char *, ptrdiff_t);
2906extern Lisp_Object make_formatted_string (char *, const char *, ...) 3094extern Lisp_Object make_formatted_string (char *, const char *, ...)
@@ -2947,6 +3135,27 @@ extern void make_byte_code (struct Lisp_Vector *);
2947extern Lisp_Object Qautomatic_gc; 3135extern Lisp_Object Qautomatic_gc;
2948extern Lisp_Object Qchar_table_extra_slots; 3136extern Lisp_Object Qchar_table_extra_slots;
2949extern struct Lisp_Vector *allocate_vector (EMACS_INT); 3137extern struct Lisp_Vector *allocate_vector (EMACS_INT);
3138
3139/* Make an uninitialized vector for SIZE objects. NOTE: you must
3140 be sure that GC cannot happen until the vector is completely
3141 initialized. E.g. the following code is likely to crash:
3142
3143 v = make_uninit_vector (3);
3144 ASET (v, 0, obj0);
3145 ASET (v, 1, Ffunction_can_gc ());
3146 ASET (v, 2, obj1); */
3147
3148LISP_INLINE Lisp_Object
3149make_uninit_vector (ptrdiff_t size)
3150{
3151 Lisp_Object v;
3152 struct Lisp_Vector *p;
3153
3154 p = allocate_vector (size);
3155 XSETVECTOR (v, p);
3156 return v;
3157}
3158
2950extern struct Lisp_Vector *allocate_pseudovector (int, int, enum pvec_type); 3159extern struct Lisp_Vector *allocate_pseudovector (int, int, enum pvec_type);
2951#define ALLOCATE_PSEUDOVECTOR(typ,field,tag) \ 3160#define ALLOCATE_PSEUDOVECTOR(typ,field,tag) \
2952 ((typ*) \ 3161 ((typ*) \
@@ -2962,7 +3171,8 @@ extern bool abort_on_gc;
2962extern Lisp_Object make_float (double); 3171extern Lisp_Object make_float (double);
2963extern void display_malloc_warning (void); 3172extern void display_malloc_warning (void);
2964extern ptrdiff_t inhibit_garbage_collection (void); 3173extern ptrdiff_t inhibit_garbage_collection (void);
2965extern Lisp_Object make_save_value (void *, ptrdiff_t); 3174extern Lisp_Object make_save_value (enum Lisp_Save_Type, ...);
3175extern Lisp_Object make_save_pointer (void *);
2966extern Lisp_Object build_overlay (Lisp_Object, Lisp_Object, Lisp_Object); 3176extern Lisp_Object build_overlay (Lisp_Object, Lisp_Object, Lisp_Object);
2967extern void free_marker (Lisp_Object); 3177extern void free_marker (Lisp_Object);
2968extern void free_cons (struct Lisp_Cons *); 3178extern void free_cons (struct Lisp_Cons *);
@@ -3019,6 +3229,7 @@ extern Lisp_Object internal_with_output_to_temp_buffer
3019 (const char *, Lisp_Object (*) (Lisp_Object), Lisp_Object); 3229 (const char *, Lisp_Object (*) (Lisp_Object), Lisp_Object);
3020enum FLOAT_TO_STRING_BUFSIZE { FLOAT_TO_STRING_BUFSIZE = 350 }; 3230enum FLOAT_TO_STRING_BUFSIZE { FLOAT_TO_STRING_BUFSIZE = 350 };
3021extern int float_to_string (char *, double); 3231extern int float_to_string (char *, double);
3232extern void init_print_once (void);
3022extern void syms_of_print (void); 3233extern void syms_of_print (void);
3023 3234
3024/* Defined in doprnt.c. */ 3235/* Defined in doprnt.c. */
@@ -3174,7 +3385,6 @@ extern void keys_of_buffer (void);
3174extern ptrdiff_t marker_position (Lisp_Object); 3385extern ptrdiff_t marker_position (Lisp_Object);
3175extern ptrdiff_t marker_byte_position (Lisp_Object); 3386extern ptrdiff_t marker_byte_position (Lisp_Object);
3176extern void clear_charpos_cache (struct buffer *); 3387extern void clear_charpos_cache (struct buffer *);
3177extern ptrdiff_t charpos_to_bytepos (ptrdiff_t);
3178extern ptrdiff_t buf_charpos_to_bytepos (struct buffer *, ptrdiff_t); 3388extern ptrdiff_t buf_charpos_to_bytepos (struct buffer *, ptrdiff_t);
3179extern ptrdiff_t buf_bytepos_to_charpos (struct buffer *, ptrdiff_t); 3389extern ptrdiff_t buf_bytepos_to_charpos (struct buffer *, ptrdiff_t);
3180extern void unchain_marker (struct Lisp_Marker *marker); 3390extern void unchain_marker (struct Lisp_Marker *marker);
@@ -3197,9 +3407,11 @@ EXFUN (Fread_file_name, 6); /* Not a normal DEFUN. */
3197extern Lisp_Object close_file_unwind (Lisp_Object); 3407extern Lisp_Object close_file_unwind (Lisp_Object);
3198extern Lisp_Object restore_point_unwind (Lisp_Object); 3408extern Lisp_Object restore_point_unwind (Lisp_Object);
3199extern _Noreturn void report_file_error (const char *, Lisp_Object); 3409extern _Noreturn void report_file_error (const char *, Lisp_Object);
3200extern void internal_delete_file (Lisp_Object); 3410extern bool internal_delete_file (Lisp_Object);
3411extern Lisp_Object emacs_readlinkat (int, const char *);
3201extern bool file_directory_p (const char *); 3412extern bool file_directory_p (const char *);
3202extern bool file_accessible_directory_p (const char *); 3413extern bool file_accessible_directory_p (const char *);
3414extern void init_fileio (void);
3203extern void syms_of_fileio (void); 3415extern void syms_of_fileio (void);
3204extern Lisp_Object make_temp_name (Lisp_Object, bool); 3416extern Lisp_Object make_temp_name (Lisp_Object, bool);
3205extern Lisp_Object Qdelete_file; 3417extern Lisp_Object Qdelete_file;
@@ -3212,20 +3424,21 @@ extern void record_unwind_save_match_data (void);
3212struct re_registers; 3424struct re_registers;
3213extern struct re_pattern_buffer *compile_pattern (Lisp_Object, 3425extern struct re_pattern_buffer *compile_pattern (Lisp_Object,
3214 struct re_registers *, 3426 struct re_registers *,
3215 Lisp_Object, int, int); 3427 Lisp_Object, bool, bool);
3216extern ptrdiff_t fast_string_match (Lisp_Object, Lisp_Object); 3428extern ptrdiff_t fast_string_match (Lisp_Object, Lisp_Object);
3217extern ptrdiff_t fast_c_string_match_ignore_case (Lisp_Object, const char *, 3429extern ptrdiff_t fast_c_string_match_ignore_case (Lisp_Object, const char *,
3218 ptrdiff_t); 3430 ptrdiff_t);
3219extern ptrdiff_t fast_string_match_ignore_case (Lisp_Object, Lisp_Object); 3431extern ptrdiff_t fast_string_match_ignore_case (Lisp_Object, Lisp_Object);
3220extern ptrdiff_t fast_looking_at (Lisp_Object, ptrdiff_t, ptrdiff_t, 3432extern ptrdiff_t fast_looking_at (Lisp_Object, ptrdiff_t, ptrdiff_t,
3221 ptrdiff_t, ptrdiff_t, Lisp_Object); 3433 ptrdiff_t, ptrdiff_t, Lisp_Object);
3222extern ptrdiff_t scan_buffer (int, ptrdiff_t, ptrdiff_t, ptrdiff_t, 3434extern ptrdiff_t find_newline (ptrdiff_t, ptrdiff_t, ptrdiff_t, ptrdiff_t,
3223 ptrdiff_t *, bool); 3435 ptrdiff_t, ptrdiff_t *, ptrdiff_t *, bool);
3224extern EMACS_INT scan_newline (ptrdiff_t, ptrdiff_t, ptrdiff_t, ptrdiff_t, 3436extern EMACS_INT scan_newline (ptrdiff_t, ptrdiff_t, ptrdiff_t, ptrdiff_t,
3225 EMACS_INT, bool); 3437 EMACS_INT, bool);
3226extern ptrdiff_t find_next_newline (ptrdiff_t, int); 3438extern ptrdiff_t find_newline_no_quit (ptrdiff_t, ptrdiff_t,
3227extern ptrdiff_t find_next_newline_no_quit (ptrdiff_t, ptrdiff_t); 3439 ptrdiff_t, ptrdiff_t *);
3228extern ptrdiff_t find_before_next_newline (ptrdiff_t, ptrdiff_t, ptrdiff_t); 3440extern ptrdiff_t find_before_next_newline (ptrdiff_t, ptrdiff_t,
3441 ptrdiff_t, ptrdiff_t *);
3229extern void syms_of_search (void); 3442extern void syms_of_search (void);
3230extern void clear_regexp_cache (void); 3443extern void clear_regexp_cache (void);
3231 3444
@@ -3242,7 +3455,7 @@ extern void syms_of_minibuf (void);
3242 3455
3243extern Lisp_Object Qminus, Qplus; 3456extern Lisp_Object Qminus, Qplus;
3244extern Lisp_Object Qwhen; 3457extern Lisp_Object Qwhen;
3245extern Lisp_Object Qcall_interactively, Qmouse_leave_buffer_hook; 3458extern Lisp_Object Qmouse_leave_buffer_hook;
3246extern void syms_of_callint (void); 3459extern void syms_of_callint (void);
3247 3460
3248/* Defined in casefiddle.c. */ 3461/* Defined in casefiddle.c. */
@@ -3298,7 +3511,7 @@ extern Lisp_Object Qvisible;
3298extern void store_frame_param (struct frame *, Lisp_Object, Lisp_Object); 3511extern void store_frame_param (struct frame *, Lisp_Object, Lisp_Object);
3299extern void store_in_alist (Lisp_Object *, Lisp_Object, Lisp_Object); 3512extern void store_in_alist (Lisp_Object *, Lisp_Object, Lisp_Object);
3300extern Lisp_Object do_switch_frame (Lisp_Object, int, int, Lisp_Object); 3513extern Lisp_Object do_switch_frame (Lisp_Object, int, int, Lisp_Object);
3301#if HAVE_NS 3514#if HAVE_NS || defined(WINDOWSNT)
3302extern Lisp_Object get_frame_param (struct frame *, Lisp_Object); 3515extern Lisp_Object get_frame_param (struct frame *, Lisp_Object);
3303#endif 3516#endif
3304extern void frames_discard_buffer (Lisp_Object); 3517extern void frames_discard_buffer (Lisp_Object);
@@ -3353,10 +3566,10 @@ extern bool running_asynch_code;
3353extern Lisp_Object QCtype, Qlocal; 3566extern Lisp_Object QCtype, Qlocal;
3354extern Lisp_Object Qprocessp; 3567extern Lisp_Object Qprocessp;
3355extern void kill_buffer_processes (Lisp_Object); 3568extern void kill_buffer_processes (Lisp_Object);
3356extern int wait_reading_process_output (intmax_t, int, int, bool, 3569extern bool wait_reading_process_output (intmax_t, int, int, bool,
3357 Lisp_Object, 3570 Lisp_Object,
3358 struct Lisp_Process *, 3571 struct Lisp_Process *,
3359 int); 3572 int);
3360/* Max value for the first argument of wait_reading_process_output. */ 3573/* Max value for the first argument of wait_reading_process_output. */
3361#if __GNUC__ == 3 || (__GNUC__ == 4 && __GNUC_MINOR__ <= 5) 3574#if __GNUC__ == 3 || (__GNUC__ == 4 && __GNUC_MINOR__ <= 5)
3362/* Work around a bug in GCC 3.4.2, known to be fixed in GCC 4.6.3. 3575/* Work around a bug in GCC 3.4.2, known to be fixed in GCC 4.6.3.
@@ -3393,7 +3606,6 @@ extern void syms_of_doc (void);
3393extern int read_bytecode_char (bool); 3606extern int read_bytecode_char (bool);
3394 3607
3395/* Defined in bytecode.c. */ 3608/* Defined in bytecode.c. */
3396extern Lisp_Object Qbytecode;
3397extern void syms_of_bytecode (void); 3609extern void syms_of_bytecode (void);
3398extern struct byte_stack *byte_stack_list; 3610extern struct byte_stack *byte_stack_list;
3399#if BYTE_MARK_STACK 3611#if BYTE_MARK_STACK
@@ -3404,7 +3616,6 @@ extern Lisp_Object exec_byte_code (Lisp_Object, Lisp_Object, Lisp_Object,
3404 Lisp_Object, ptrdiff_t, Lisp_Object *); 3616 Lisp_Object, ptrdiff_t, Lisp_Object *);
3405 3617
3406/* Defined in macros.c. */ 3618/* Defined in macros.c. */
3407extern Lisp_Object Qexecute_kbd_macro;
3408extern void init_macros (void); 3619extern void init_macros (void);
3409extern void syms_of_macros (void); 3620extern void syms_of_macros (void);
3410 3621
@@ -3451,6 +3662,8 @@ extern void init_sigio (int);
3451extern void sys_subshell (void); 3662extern void sys_subshell (void);
3452extern void sys_suspend (void); 3663extern void sys_suspend (void);
3453extern void discard_tty_input (void); 3664extern void discard_tty_input (void);
3665extern void block_tty_out_signal (void);
3666extern void unblock_tty_out_signal (void);
3454extern void init_sys_modes (struct tty_display_info *); 3667extern void init_sys_modes (struct tty_display_info *);
3455extern void reset_sys_modes (struct tty_display_info *); 3668extern void reset_sys_modes (struct tty_display_info *);
3456extern void init_all_sys_modes (void); 3669extern void init_all_sys_modes (void);
@@ -3468,8 +3681,6 @@ extern int emacs_open (const char *, int, int);
3468extern int emacs_close (int); 3681extern int emacs_close (int);
3469extern ptrdiff_t emacs_read (int, char *, ptrdiff_t); 3682extern ptrdiff_t emacs_read (int, char *, ptrdiff_t);
3470extern ptrdiff_t emacs_write (int, const char *, ptrdiff_t); 3683extern ptrdiff_t emacs_write (int, const char *, ptrdiff_t);
3471enum { READLINK_BUFSIZE = 1024 };
3472extern char *emacs_readlink (const char *, char [READLINK_BUFSIZE]);
3473 3684
3474extern void unlock_all_files (void); 3685extern void unlock_all_files (void);
3475extern void lock_file (Lisp_Object); 3686extern void lock_file (Lisp_Object);
@@ -3515,6 +3726,16 @@ extern void syms_of_fontset (void);
3515extern Lisp_Object Qfont_param; 3726extern Lisp_Object Qfont_param;
3516#endif 3727#endif
3517 3728
3729#ifdef WINDOWSNT
3730/* Defined on w32notify.c. */
3731extern void syms_of_w32notify (void);
3732#endif
3733
3734/* Defined in inotify.c */
3735#ifdef HAVE_INOTIFY
3736extern void syms_of_inotify (void);
3737#endif
3738
3518/* Defined in xfaces.c. */ 3739/* Defined in xfaces.c. */
3519extern Lisp_Object Qdefault, Qtool_bar, Qfringe; 3740extern Lisp_Object Qdefault, Qtool_bar, Qfringe;
3520extern Lisp_Object Qheader_line, Qscroll_bar, Qcursor; 3741extern Lisp_Object Qheader_line, Qscroll_bar, Qcursor;
@@ -3593,18 +3814,18 @@ extern void *xnrealloc (void *, ptrdiff_t, ptrdiff_t);
3593extern void *xpalloc (void *, ptrdiff_t *, ptrdiff_t, ptrdiff_t, ptrdiff_t); 3814extern void *xpalloc (void *, ptrdiff_t *, ptrdiff_t, ptrdiff_t, ptrdiff_t);
3594 3815
3595extern char *xstrdup (const char *); 3816extern char *xstrdup (const char *);
3817extern void xputenv (const char *);
3596 3818
3597extern char *egetenv (const char *); 3819extern char *egetenv (const char *);
3598 3820
3599/* Set up the name of the machine we're running on. */ 3821/* Set up the name of the machine we're running on. */
3600extern void init_system_name (void); 3822extern void init_system_name (void);
3601 3823
3602/* We used to use `abs', but that clashes with system headers on some 3824/* Return the absolute value of X. X should be a signed integer
3603 platforms, and using a name reserved by Standard C is a bad idea 3825 expression without side effects, and X's absolute value should not
3604 anyway. */ 3826 exceed the maximum for its promoted type. This is called 'eabs'
3605#if !defined (eabs) 3827 because 'abs' is reserved by the C standard. */
3606#define eabs(x) ((x) < 0 ? -(x) : (x)) 3828#define eabs(x) ((x) < 0 ? -(x) : (x))
3607#endif
3608 3829
3609/* Return a fixnum or float, depending on whether VAL fits in a Lisp 3830/* Return a fixnum or float, depending on whether VAL fits in a Lisp
3610 fixnum. */ 3831 fixnum. */
@@ -3633,16 +3854,16 @@ extern void *record_xmalloc (size_t);
3633 NITEMS items, each of the same type as *BUF. MULTIPLIER must 3854 NITEMS items, each of the same type as *BUF. MULTIPLIER must
3634 positive. The code is tuned for MULTIPLIER being a constant. */ 3855 positive. The code is tuned for MULTIPLIER being a constant. */
3635 3856
3636#define SAFE_NALLOCA(buf, multiplier, nitems) \ 3857#define SAFE_NALLOCA(buf, multiplier, nitems) \
3637 do { \ 3858 do { \
3638 if ((nitems) <= MAX_ALLOCA / sizeof *(buf) / (multiplier)) \ 3859 if ((nitems) <= MAX_ALLOCA / sizeof *(buf) / (multiplier)) \
3639 (buf) = alloca (sizeof *(buf) * (multiplier) * (nitems)); \ 3860 (buf) = alloca (sizeof *(buf) * (multiplier) * (nitems)); \
3640 else \ 3861 else \
3641 { \ 3862 { \
3642 (buf) = xnmalloc (nitems, sizeof *(buf) * (multiplier)); \ 3863 (buf) = xnmalloc (nitems, sizeof *(buf) * (multiplier)); \
3643 sa_must_free = 1; \ 3864 sa_must_free = 1; \
3644 record_unwind_protect (safe_alloca_unwind, \ 3865 record_unwind_protect (safe_alloca_unwind, \
3645 make_save_value (buf, 0)); \ 3866 make_save_pointer (buf)); \
3646 } \ 3867 } \
3647 } while (0) 3868 } while (0)
3648 3869
@@ -3667,8 +3888,7 @@ extern void *record_xmalloc (size_t);
3667 { \ 3888 { \
3668 Lisp_Object arg_; \ 3889 Lisp_Object arg_; \
3669 buf = xmalloc ((nelt) * word_size); \ 3890 buf = xmalloc ((nelt) * word_size); \
3670 arg_ = make_save_value (buf, nelt); \ 3891 arg_ = make_save_value (SAVE_TYPE_MEMORY, buf, nelt); \
3671 XSAVE_VALUE (arg_)->dogc = 1; \
3672 sa_must_free = 1; \ 3892 sa_must_free = 1; \
3673 record_unwind_protect (safe_alloca_unwind, arg_); \ 3893 record_unwind_protect (safe_alloca_unwind, arg_); \
3674 } \ 3894 } \