-Copyright (C) 1985-1989, 1993, 1995, 2001-2011
- Free Software Foundation, Inc.
+Copyright (C) 1985-1989, 1993, 1995, 2001-2013 Free Software Foundation,
+Inc.
if (BOUNDARY_POS (c, low) > pos
|| (low + 1 < c->cache_len
&& BOUNDARY_POS (c, low + 1) <= pos))
if (BOUNDARY_POS (c, low) > pos
|| (low + 1 < c->cache_len
&& BOUNDARY_POS (c, low + 1) <= pos))
/* We mustn't ever try to put the gap before the dummy start
boundary. That must always be start-relative. */
if (pos == 0)
/* We mustn't ever try to put the gap before the dummy start
boundary. That must always be start-relative. */
if (pos == 0)
- xpalloc (c->boundaries, &c->cache_len, min_size, -1,
+ xpalloc (c->boundaries, &nboundaries, min_size - gap_len, -1,
sizeof *c->boundaries);
/* Some systems don't provide a version of the copy routine that
can be trusted to shift memory upward into an overlapping
region. memmove isn't widely available. */
sizeof *c->boundaries);
/* Some systems don't provide a version of the copy routine that
can be trusted to shift memory upward into an overlapping
region. memmove isn't widely available. */
for (i = c->cache_len - 1; i >= gap_start; i--)
{
c->boundaries[i + min_size].pos = c->boundaries[i + gap_len].pos;
for (i = c->cache_len - 1; i >= gap_start; i--)
{
c->boundaries[i + min_size].pos = c->boundaries[i + gap_len].pos;
/* We must only be inserting things in order. */
if (! (BOUNDARY_POS (c, i - 1) < pos
&& (i == c->cache_len
|| pos < BOUNDARY_POS (c, i))))
/* We must only be inserting things in order. */
if (! (BOUNDARY_POS (c, i - 1) < pos
&& (i == c->cache_len
|| pos < BOUNDARY_POS (c, i))))
/* The value must be different from the ones around it. However, we
temporarily create boundaries that establish the same value as
the subsequent boundary, so we're not going to flag that case. */
if (BOUNDARY_VALUE (c, i - 1) == value)
/* The value must be different from the ones around it. However, we
temporarily create boundaries that establish the same value as
the subsequent boundary, so we're not going to flag that case. */
if (BOUNDARY_VALUE (c, i - 1) == value)
/* Eliminate this case; then we can assume that start and end-1 are
both the locations of real characters in the buffer. */
/* Eliminate this case; then we can assume that start and end-1 are
both the locations of real characters in the buffer. */
/* Return true if the text immediately after POS in BUF is known, for
the purposes of CACHE. If NEXT is non-zero, set *NEXT to the nearest
/* Return true if the text immediately after POS in BUF is known, for
the purposes of CACHE. If NEXT is non-zero, set *NEXT to the nearest
int
region_cache_forward (struct buffer *buf, struct region_cache *c,
ptrdiff_t pos, ptrdiff_t *next)
int
region_cache_forward (struct buffer *buf, struct region_cache *c,
ptrdiff_t pos, ptrdiff_t *next)
/* Return true if the text immediately before POS in BUF is known, for
the purposes of CACHE. If NEXT is non-zero, set *NEXT to the nearest
/* Return true if the text immediately before POS in BUF is known, for
the purposes of CACHE. If NEXT is non-zero, set *NEXT to the nearest
int region_cache_backward (struct buffer *buf, struct region_cache *c,
ptrdiff_t pos, ptrdiff_t *next)
{
int region_cache_backward (struct buffer *buf, struct region_cache *c,
ptrdiff_t pos, ptrdiff_t *next)
{