]> wimlib.net Git - wimlib/commitdiff
Annotate yet another unaligned memory access
authorEric Biggers <ebiggers3@gmail.com>
Thu, 11 Dec 2014 01:14:40 +0000 (19:14 -0600)
committerEric Biggers <ebiggers3@gmail.com>
Thu, 11 Dec 2014 01:14:40 +0000 (19:14 -0600)
src/lz_binary_trees.c

index 4a0537cb4df42ef9ebedd880185fc0c1a6acc734..fa866b89e7c71a6d7d5117478b7bf163afb5dbcd 100644 (file)
@@ -437,7 +437,7 @@ lz_bt_get_matches(struct lz_mf *_mf, struct lz_match matches[])
                /* Search the digram table for a length 2 match.  */
 
                const u16 digram = mf->next_digram;
                /* Search the digram table for a length 2 match.  */
 
                const u16 digram = mf->next_digram;
-               mf->next_digram = *(const u16 *)(&window[cur_pos + 1]);
+               mf->next_digram = load_u16_unaligned(&window[cur_pos + 1]);
                prefetch(&mf->digram_tab[mf->next_digram]);
                cur_match = mf->digram_tab[digram];
                mf->digram_tab[digram] = cur_pos;
                prefetch(&mf->digram_tab[mf->next_digram]);
                cur_match = mf->digram_tab[digram];
                mf->digram_tab[digram] = cur_pos;
@@ -563,7 +563,7 @@ lz_bt_skip_positions(struct lz_mf *_mf, u32 n)
        do {
                if (mf->digram_tab) {
                        digram = next_digram;
        do {
                if (mf->digram_tab) {
                        digram = next_digram;
-                       next_digram = *(const u16 *)(&window[cur_pos + 1]);
+                       next_digram = load_u16_unaligned(&window[cur_pos + 1]);
                        mf->digram_tab[digram] = cur_pos;
                }
 
                        mf->digram_tab[digram] = cur_pos;
                }