1. 10 Dec, 2014 1 commit
    • Eli Zaretskii's avatar
      Fix out-of-memory condition in display of long bracketed lines (bug#19322) · f3e16cbb
      Eli Zaretskii authored
       src/bidi.c (BIDI_CACHE_MAX_ELTS_PER_SLOT): New macro.
       (bidi_cache_max_elts): New global variable.
       (bidi_shelve_header_size): Add the sizeof bidi_cache_max_elts.
       (bidi_cache_shrink, bidi_initialize): Reset bidi_cache_max_elts to
       its initial value.
       (bidi_cache_search): Handle overflown cache.  Improve commentary.
       (bidi_cache_ensure_space): Limit allocations to the current value
       of bidi_cache_max_elts.  Force xpalloc not to over-allocate.  If
       less than a full BIDI_CACHE_CHUNK is left to the limit, decrease
       the increment to not exceed the limit.
       (bidi_cache_iterator_state): Now returns non-zero if succeeded to
       cache, zero otherwise (meaning the cache overflowed).  In the
       latter case, set bidi_cache_last_idx to -1.
       (bidi_peek_at_next_level): Handle overflown cache.
       (bidi_push_it): Increase the cache limit for iterating the new
       (bidi_pop_it): Decrease the cache limit back to previous value.
       (bidi_shelve_cache): Shelve the current value of the cache limit.
       (bidi_unshelve_cache): Restore the value of cache limit.
       (bidi_find_bracket_pairs): If the cache overflows while looking
       for the paired bracket, give up and let bidi_resolve_neutrals
       process the bracket as a simple neutral.
       (bidi_find_other_level_edge): If the cache overflows, fall back on
       Plan B, which effectively stops the reordering and restarts it on
       the next character (after resetting the cache).
       (bidi_move_to_visually_next): When the cache overflows, reset it
       after processing the last cached character.
  2. 05 Dec, 2014 1 commit
    • Eli Zaretskii's avatar
      Reduce memory footprint of struct bidi_it by a factor of 5. · fcc4da3e
      Eli Zaretskii authored
       src/dispextern.h (enum bidi_dir_t): Force NEUTRAL_DIR to be zero.
       (struct bidi_stack): Reduce size by using bit fields and by
       packing sos, override, and isolate_status into a single 8-bit
       byte called 'flags'.
       src/bidi.c (ISOLATE_STATUS, OVERRIDE): New macros.
       (bidi_push_embedding_level): Construct flags from individual
       bits.  Adapt to changes in prev_for_neutral and next_for_neutral
       (bidi_pop_embedding_level): Use ISOLATE_STATUS.  Extract 'sos'
       from flags.  Adapt to changes in prev_for_neutral,
       next_for_neutral, and last_strong members.
       (bidi_line_init): Initialize flags to zero.
       (bidi_resolve_explicit, bidi_resolve_weak, bidi_resolve_brackets)
       (bidi_resolve_neutral): Use ISOLATE_STATUS and OVERRIDE.
  3. 02 Dec, 2014 1 commit
    • Eli Zaretskii's avatar
      Allow to search for characters whose bidi directionality was overridden. · dd601050
      Eli Zaretskii authored
       src/bidi.c (bidi_find_first_overridden): New function.
       src/xdisp.c (Fbidi_find_overridden_directionality): New function.
       (syms_of_xdisp): Defsubr it.
       src/dispextern.h (bidi_find_first_overridden): Add prototype.
       doc/lispref/display.texi (Bidirectional Display): Document
       etc/NEWS: Mention 'bidi-find-overridden-directionality'.
  4. 30 Oct, 2014 1 commit
    • Eli Zaretskii's avatar
      Minor fix in bidi.c:bidi_cache_reset_to. · b6a74742
      Eli Zaretskii authored
       src/bidi.c (bidi_cache_reset_to): Invalidate bidi_cache_last_idx by
       setting it to -1.
       (bidi_find_bracket_pairs): Pass to bidi_cache_reset_to a relative
       index, not an absolute one, as that's what the function expects.
  5. 24 Oct, 2014 1 commit
  6. 22 Oct, 2014 1 commit
    • Eli Zaretskii's avatar
      Fix bug #18778 with slow redisplay of bracketed L2R text with long lines. · 6a7884ca
      Eli Zaretskii authored
       src/bidi.c (bidi_cache_reset_to): New function.
       (bidi_cache_reset): Call it.
       (bidi_init_it, bidi_line_init): Initialize the bracket_pairing_pos
       member to -1.
       (bidi_resolve_explicit): Reset bracket_pairing_pos and
       bracket_enclosed_type only if bracket_pairing_pos's value is not
       (MAX_BPA_STACK): Make sure the value is signed.
       (PUSH_BPA_STACK): If the BPA stack overflows, don't bail out, but
       stop pushing values onto the stack.
       (bidi_find_bracket_pairs): If the bracketed text is only on the
       base embedding level, remove all the states cached by this
       function from the cache, and return zero, so that the brackets in
       this segment of text are processed as normal neutrals.
       (bidi_resolve_brackets): Detect the brackets that are to be
       processed as neutrals, and don't call bidi_find_bracket_pairs on
  7. 20 Oct, 2014 1 commit
  8. 18 Oct, 2014 3 commits
  9. 16 Oct, 2014 3 commits
  10. 15 Oct, 2014 3 commits
  11. 14 Oct, 2014 2 commits
  12. 13 Oct, 2014 1 commit
  13. 12 Oct, 2014 2 commits
  14. 11 Oct, 2014 3 commits
  15. 10 Oct, 2014 1 commit
  16. 09 Oct, 2014 1 commit
  17. 04 Oct, 2014 2 commits
  18. 03 Oct, 2014 1 commit
  19. 27 Sep, 2014 1 commit
  20. 26 Sep, 2014 2 commits
  21. 24 Sep, 2014 2 commits
  22. 20 Sep, 2014 2 commits
  23. 19 Sep, 2014 1 commit
  24. 13 Sep, 2014 1 commit
  25. 06 Sep, 2014 1 commit
  26. 30 Aug, 2014 1 commit