diff options
| author | Yuuki Harano | 2021-11-11 00:39:53 +0900 |
|---|---|---|
| committer | Yuuki Harano | 2021-11-11 00:39:53 +0900 |
| commit | 4dd1f56f29fc598a8339a345c2f8945250600602 (patch) | |
| tree | af341efedffe027e533b1bcc0dbf270532e48285 /src/buffer.h | |
| parent | 4c49ec7f865bdad1629d2f125f71f4e506b258f2 (diff) | |
| parent | 810fa21d26453f898de9747ece7205dfe6de9d08 (diff) | |
| download | emacs-4dd1f56f29fc598a8339a345c2f8945250600602.tar.gz emacs-4dd1f56f29fc598a8339a345c2f8945250600602.zip | |
Merge branch 'master' of git.savannah.gnu.org:/srv/git/emacs into feature/pgtk
Diffstat (limited to 'src/buffer.h')
| -rw-r--r-- | src/buffer.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/buffer.h b/src/buffer.h index 24e9c3fcbc8..8623bed08e6 100644 --- a/src/buffer.h +++ b/src/buffer.h | |||
| @@ -60,6 +60,14 @@ enum { BEG = 1, BEG_BYTE = BEG }; | |||
| 60 | 60 | ||
| 61 | /* Macros for the addresses of places in the buffer. */ | 61 | /* Macros for the addresses of places in the buffer. */ |
| 62 | 62 | ||
| 63 | /* WARNING: Use the 'char *' pointers to buffer text with care in code | ||
| 64 | that could GC: GC can relocate buffer text, invalidating such | ||
| 65 | pointers. It is best to use character or byte position instead, | ||
| 66 | delaying the access through BYTE_POS_ADDR etc. pointers to the | ||
| 67 | latest possible moment. If you must use the 'char *' pointers | ||
| 68 | (e.g., for speed), be sure to adjust them after any call that could | ||
| 69 | potentially GC. */ | ||
| 70 | |||
| 63 | /* Address of beginning of buffer. */ | 71 | /* Address of beginning of buffer. */ |
| 64 | #define BEG_ADDR (current_buffer->text->beg) | 72 | #define BEG_ADDR (current_buffer->text->beg) |
| 65 | 73 | ||
| @@ -1002,6 +1010,9 @@ SET_BUF_PT_BOTH (struct buffer *buf, ptrdiff_t charpos, ptrdiff_t byte) | |||
| 1002 | or convert between a byte position and an address. | 1010 | or convert between a byte position and an address. |
| 1003 | These functions do not check that the position is in range. */ | 1011 | These functions do not check that the position is in range. */ |
| 1004 | 1012 | ||
| 1013 | /* See the important WARNING above about using the 'char *' pointers | ||
| 1014 | returned by these functions. */ | ||
| 1015 | |||
| 1005 | /* Return the address of byte position N in current buffer. */ | 1016 | /* Return the address of byte position N in current buffer. */ |
| 1006 | 1017 | ||
| 1007 | INLINE unsigned char * | 1018 | INLINE unsigned char * |