}
INLINE void
-buffer_overlay_iter_start (struct buffer *b, ptrdiff_t begin, ptrdiff_t end,
- enum interval_tree_order order)
+buffer_overlay_iter_start1 (struct buffer *b, ptrdiff_t begin, ptrdiff_t end,
+ enum interval_tree_order order, const char* file, int line)
{
if (b->overlays)
- interval_tree_iter_start (b->overlays, begin, end, order);
+ interval_tree_iter_start (b->overlays, begin, end, order, file, line);
}
+#define buffer_overlay_iter_start(b, begin, end, order) \
+ buffer_overlay_iter_start1 ((b), (begin), (end), (order), __FILE__, __LINE__)
+
INLINE struct interval_node*
buffer_overlay_iter_next (struct buffer *b)
{
{
struct interval_node *other;
- interval_tree_iter_start (tree, node->begin, PTRDIFF_MAX, ITREE_ASCENDING);
+ interval_tree_iter_start (tree, node->begin, PTRDIFF_MAX, ITREE_ASCENDING, __FILE__, __LINE__);
while ((other = interval_tree_iter_next (tree)))
if (other == node)
break;
{
struct interval_node *node;
- interval_tree_iter_start (tree, PTRDIFF_MIN, PTRDIFF_MAX, order);
+ interval_tree_iter_start (tree, PTRDIFF_MIN, PTRDIFF_MAX, order, __FILE__, __LINE__);
while ((node = interval_tree_iter_next (tree)))
{
*nodes = node;
void
interval_tree_iter_start (struct interval_tree *tree,
ptrdiff_t begin, ptrdiff_t end,
- enum interval_tree_order order)
+ enum interval_tree_order order,
+ const char* file, int line)
{
if (tree->iter_running)
emacs_abort ();
interval_generator_reset (tree->iter, begin, end, order);
tree->iter_running = 1;
+ tree->file = file;
+ tree->line = line;
}
/* Limit the search interval of the iterator to the given values. The
order, so we need to remove them first. */
struct interval_stack *saved = interval_stack_create (0);
struct interval_node *node = NULL;
- interval_tree_iter_start (tree, pos, pos + 1, ITREE_PRE_ORDER);
+ interval_tree_iter_start (tree, pos, pos + 1, ITREE_PRE_ORDER, __FILE__, __LINE__);
while ((node = interval_tree_iter_next (tree)))
{
if (node->begin == pos && node->front_advance
intmax_t size; /* Number of nodes in the tree. */
struct interval_generator *iter;
bool_bf iter_running : 1;
+ const char* file;
+ int line;
};
enum interval_tree_order {
void interval_tree_insert (struct interval_tree *, struct interval_node *);
bool interval_tree_contains (struct interval_tree *, struct interval_node *);
struct interval_node *interval_tree_remove (struct interval_tree *, struct interval_node *);
-void interval_tree_iter_start (struct interval_tree *, ptrdiff_t, ptrdiff_t, enum interval_tree_order);
+void interval_tree_iter_start (struct interval_tree *, ptrdiff_t, ptrdiff_t, enum interval_tree_order,
+ const char* file, int line);
void interval_tree_iter_narrow (struct interval_tree *, ptrdiff_t, ptrdiff_t);
void interval_tree_iter_finish (struct interval_tree *);
struct interval_node *interval_tree_iter_next (struct interval_tree *);