aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2016-11-04 10:36:02 +0200
committerEli Zaretskii2016-11-04 10:36:02 +0200
commit0221b7a9b511db2ebcbe5f41c1fa20d2f3d70599 (patch)
treeacdc0e1150ccebdea24e7596e7cd2433a0803472 /src
parent5043e0a7e06dbf6507a59736e55bdde69d9a2a4e (diff)
downloademacs-0221b7a9b511db2ebcbe5f41c1fa20d2f3d70599.tar.gz
emacs-0221b7a9b511db2ebcbe5f41c1fa20d2f3d70599.zip
Mark relocation workarounds with REL_ALLOC
* src/search.c (boyer_moore): Mark workarounds for ralloc.c relocation of buffer text with "#ifdef REL_ALLOC".
Diffstat (limited to 'src')
-rw-r--r--src/search.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/search.c b/src/search.c
index 15504be042b..9f55d728362 100644
--- a/src/search.c
+++ b/src/search.c
@@ -2029,20 +2029,27 @@ boyer_moore (EMACS_INT n, unsigned char *base_pat,
2029 cursor += dirlen - i - direction; /* fix cursor */ 2029 cursor += dirlen - i - direction; /* fix cursor */
2030 if (i + direction == 0) 2030 if (i + direction == 0)
2031 { 2031 {
2032 ptrdiff_t position, start, end, cursor_off; 2032 ptrdiff_t position, start, end;
2033#ifdef REL_ALLOC
2034 ptrdiff_t cursor_off;
2035#endif
2033 2036
2034 cursor -= direction; 2037 cursor -= direction;
2035 2038
2036 position = pos_byte + cursor - p2 + ((direction > 0) 2039 position = pos_byte + cursor - p2 + ((direction > 0)
2037 ? 1 - len_byte : 0); 2040 ? 1 - len_byte : 0);
2041#ifdef REL_ALLOC
2038 /* set_search_regs might call malloc, which could 2042 /* set_search_regs might call malloc, which could
2039 cause ralloc.c relocate buffer text. We need to 2043 cause ralloc.c relocate buffer text. We need to
2040 update pointers into buffer text due to that. */ 2044 update pointers into buffer text due to that. */
2041 cursor_off = cursor - p2; 2045 cursor_off = cursor - p2;
2046#endif
2042 set_search_regs (position, len_byte); 2047 set_search_regs (position, len_byte);
2048#ifdef REL_ALLOC
2043 p_limit = BYTE_POS_ADDR (limit); 2049 p_limit = BYTE_POS_ADDR (limit);
2044 p2 = BYTE_POS_ADDR (pos_byte); 2050 p2 = BYTE_POS_ADDR (pos_byte);
2045 cursor = p2 + cursor_off; 2051 cursor = p2 + cursor_off;
2052#endif
2046 2053
2047 if (NILP (Vinhibit_changing_match_data)) 2054 if (NILP (Vinhibit_changing_match_data))
2048 { 2055 {