diff options
| author | Joakim Verona | 2015-01-20 00:54:09 +0100 |
|---|---|---|
| committer | Joakim Verona | 2015-01-20 00:54:09 +0100 |
| commit | fee879f0a00bbe3f3389509874ee30a9cbc24cd4 (patch) | |
| tree | 5bc4dc325818bec8a6a4cf20b1c907d23e24425a /src/lisp.h | |
| parent | 395a90fee92a836f55df0b879f8ee3d862d648ac (diff) | |
| parent | fb6462f056f616f3da8ae18037c7c2137fecb6fd (diff) | |
| download | emacs-fee879f0a00bbe3f3389509874ee30a9cbc24cd4.tar.gz emacs-fee879f0a00bbe3f3389509874ee30a9cbc24cd4.zip | |
Merge branch 'master' into xwidget
Diffstat (limited to 'src/lisp.h')
| -rw-r--r-- | src/lisp.h | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/src/lisp.h b/src/lisp.h index e94e39a5d01..65e6c626527 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -732,14 +732,18 @@ struct Lisp_Symbol | |||
| 732 | TAG_PTR (Lisp_Symbol, \ | 732 | TAG_PTR (Lisp_Symbol, \ |
| 733 | ((uintptr_t) (offset) >> (USE_LSB_TAG ? 0 : GCTYPEBITS))) | 733 | ((uintptr_t) (offset) >> (USE_LSB_TAG ? 0 : GCTYPEBITS))) |
| 734 | 734 | ||
| 735 | /* XLI_BUILTIN_LISPSYM (iQwhatever) is equivalent to | ||
| 736 | XLI (builtin_lisp_symbol (Qwhatever)), | ||
| 737 | except the former expands to an integer constant expression. */ | ||
| 738 | #define XLI_BUILTIN_LISPSYM(iname) TAG_SYMOFFSET ((iname) * sizeof *lispsym) | ||
| 739 | |||
| 735 | /* Declare extern constants for Lisp symbols. These can be helpful | 740 | /* Declare extern constants for Lisp symbols. These can be helpful |
| 736 | when using a debugger like GDB, on older platforms where the debug | 741 | when using a debugger like GDB, on older platforms where the debug |
| 737 | format does not represent C macros. */ | 742 | format does not represent C macros. */ |
| 738 | #define DEFINE_LISP_SYMBOL_BEGIN(name) \ | 743 | #define DEFINE_LISP_SYMBOL_BEGIN(name) \ |
| 739 | DEFINE_GDB_SYMBOL_BEGIN (Lisp_Object, name) | 744 | DEFINE_GDB_SYMBOL_BEGIN (Lisp_Object, name) |
| 740 | #define DEFINE_LISP_SYMBOL_END(name) \ | 745 | #define DEFINE_LISP_SYMBOL_END(name) \ |
| 741 | DEFINE_GDB_SYMBOL_END (LISP_INITIALLY (TAG_SYMOFFSET (i##name \ | 746 | DEFINE_GDB_SYMBOL_END (LISP_INITIALLY (XLI_BUILTIN_LISPSYM (i##name))) |
| 742 | * sizeof *lispsym))) | ||
| 743 | 747 | ||
| 744 | #include "globals.h" | 748 | #include "globals.h" |
| 745 | 749 | ||
| @@ -1504,6 +1508,20 @@ gc_aset (Lisp_Object array, ptrdiff_t idx, Lisp_Object val) | |||
| 1504 | XVECTOR (array)->contents[idx] = val; | 1508 | XVECTOR (array)->contents[idx] = val; |
| 1505 | } | 1509 | } |
| 1506 | 1510 | ||
| 1511 | /* True, since Qnil's representation is zero. Every place in the code | ||
| 1512 | that assumes Qnil is zero should verify (NIL_IS_ZERO), to make it easy | ||
| 1513 | to find such assumptions later if we change Qnil to be nonzero. */ | ||
| 1514 | enum { NIL_IS_ZERO = XLI_BUILTIN_LISPSYM (iQnil) == 0 }; | ||
| 1515 | |||
| 1516 | /* Set a Lisp_Object array V's SIZE entries to nil. */ | ||
| 1517 | INLINE void | ||
| 1518 | memsetnil (Lisp_Object *v, ptrdiff_t size) | ||
| 1519 | { | ||
| 1520 | eassert (0 <= size); | ||
| 1521 | verify (NIL_IS_ZERO); | ||
| 1522 | memset (v, 0, size * sizeof *v); | ||
| 1523 | } | ||
| 1524 | |||
| 1507 | /* If a struct is made to look like a vector, this macro returns the length | 1525 | /* If a struct is made to look like a vector, this macro returns the length |
| 1508 | of the shortest vector that would hold that struct. */ | 1526 | of the shortest vector that would hold that struct. */ |
| 1509 | 1527 | ||