<feed xmlns='http://www.w3.org/2005/Atom'>
<title>libpinyin.git/src/storage/phrase_large_table2.cpp, branch tkrzw</title>
<subtitle>mirror of libpinyin.</subtitle>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/pwu/public_git/libpinyin.git/'/>
<entry>
<title>Fix warnings</title>
<updated>2024-07-31T03:18:42+00:00</updated>
<author>
<name>Peng Wu</name>
<email>alexepico@gmail.com</email>
</author>
<published>2024-07-31T03:18:42+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/pwu/public_git/libpinyin.git/commit/?id=b56d3375921238ac990b5251b220f292e6dfdd61'/>
<id>b56d3375921238ac990b5251b220f292e6dfdd61</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix libpinyin crash on ARMv7</title>
<updated>2022-11-29T08:16:21+00:00</updated>
<author>
<name>Matias Larsson</name>
<email>matias.larsson@matthews.se</email>
</author>
<published>2022-11-24T17:22:55+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/pwu/public_git/libpinyin.git/commit/?id=8bcea4710bd328ef74dc852d9fdffb3c47ed8abe'/>
<id>8bcea4710bd328ef74dc852d9fdffb3c47ed8abe</id>
<content type='text'>
Fix the alignment trap in get_unigram_frequency(). Fix also other
places where this same trap could happen (depending on compiler
and surrounding code).

The trap happened when the ARM GCC generated a SIMD instruction
(specifically VLDR) to load 32 bits in a single instruction, and
when the memory address was not aligned to 32 bits. VLDR traps if
the address is not aligned.

GCC generated the instruction because of the cast to uint32 from
the address. The fix is to allocate a uint32 variable in stack and
use memcpy to copy the data to that variable. This way we ensure
that appropriate instructions are generated.

**Links**

About the issue with GCC:
https://trust-in-soft.com/blog/2020/04/06/gcc-always-assumes-aligned-pointer-accesses/

How Linux does it:
https://elixir.bootlin.com/linux/v5.10.155/source/include/linux/unaligned/memmove.h#L13

ARM documentation:
https://documentation-service.arm.com/static/5f8dc043f86e16515cdbbc92?token=
    See 'A3.2.1 Unaligned data access'
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fix the alignment trap in get_unigram_frequency(). Fix also other
places where this same trap could happen (depending on compiler
and surrounding code).

The trap happened when the ARM GCC generated a SIMD instruction
(specifically VLDR) to load 32 bits in a single instruction, and
when the memory address was not aligned to 32 bits. VLDR traps if
the address is not aligned.

GCC generated the instruction because of the cast to uint32 from
the address. The fix is to allocate a uint32 variable in stack and
use memcpy to copy the data to that variable. This way we ensure
that appropriate instructions are generated.

**Links**

About the issue with GCC:
https://trust-in-soft.com/blog/2020/04/06/gcc-always-assumes-aligned-pointer-accesses/

How Linux does it:
https://elixir.bootlin.com/linux/v5.10.155/source/include/linux/unaligned/memmove.h#L13

ARM documentation:
https://documentation-service.arm.com/static/5f8dc043f86e16515cdbbc92?token=
    See 'A3.2.1 Unaligned data access'
</pre>
</div>
</content>
</entry>
<entry>
<title>Use abort function instead of assert macro</title>
<updated>2022-06-06T09:32:00+00:00</updated>
<author>
<name>Peng Wu</name>
<email>alexepico@gmail.com</email>
</author>
<published>2022-06-06T09:32:00+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/pwu/public_git/libpinyin.git/commit/?id=2323c59d337ca56c585a8b58b855e84938ecfc27'/>
<id>2323c59d337ca56c585a8b58b855e84938ecfc27</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix delimiter for reading table files on macOS</title>
<updated>2020-11-26T03:00:51+00:00</updated>
<author>
<name>Weixuan XIAO</name>
<email>veyx.shaw@gmail.com</email>
</author>
<published>2020-11-22T18:02:36+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/pwu/public_git/libpinyin.git/commit/?id=76108f9b60e521af2d716b22dd5dd99d62609e72'/>
<id>76108f9b60e521af2d716b22dd5dd99d62609e72</id>
<content type='text'>
On macOS under llvm/clang++, the default delimiter for format string is
weird: it cannot read full CJK characters from the table files.

This patch adds macOS-specified code to make "\t" and " " the implicit
delimiter.

Ref:
https://stackoverflow.com/questions/12885628/changing-the-scanf-delimiter
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
On macOS under llvm/clang++, the default delimiter for format string is
weird: it cannot read full CJK characters from the table files.

This patch adds macOS-specified code to make "\t" and " " the implicit
delimiter.

Ref:
https://stackoverflow.com/questions/12885628/changing-the-scanf-delimiter
</pre>
</div>
</content>
</entry>
<entry>
<title>fixes fscanf usage</title>
<updated>2018-01-25T04:58:23+00:00</updated>
<author>
<name>Peng Wu</name>
<email>alexepico@gmail.com</email>
</author>
<published>2018-01-25T04:58:23+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/pwu/public_git/libpinyin.git/commit/?id=ff713df50634fd5a2d3e5fd64fe5c57eb45b2b7a'/>
<id>ff713df50634fd5a2d3e5fd64fe5c57eb45b2b7a</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>update code license</title>
<updated>2016-10-31T05:56:38+00:00</updated>
<author>
<name>Peng Wu</name>
<email>alexepico@gmail.com</email>
</author>
<published>2016-10-31T05:56:38+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/pwu/public_git/libpinyin.git/commit/?id=62cacd1dc8784f7d3e99503d0e8e66010597eb05'/>
<id>62cacd1dc8784f7d3e99503d0e8e66010597eb05</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>fixes warnings</title>
<updated>2016-03-15T05:26:06+00:00</updated>
<author>
<name>Peng Wu</name>
<email>alexepico@gmail.com</email>
</author>
<published>2016-03-15T05:26:06+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/pwu/public_git/libpinyin.git/commit/?id=63ad8a96490927f6261089e7c59d23d00cb2f069'/>
<id>63ad8a96490927f6261089e7c59d23d00cb2f069</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>fixes fscanf</title>
<updated>2014-03-13T01:40:48+00:00</updated>
<author>
<name>Peng Wu</name>
<email>alexepico@gmail.com</email>
</author>
<published>2014-03-13T01:40:48+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/pwu/public_git/libpinyin.git/commit/?id=6a3fd302f0ca63ce02cda81950987fa0cdbea610'/>
<id>6a3fd302f0ca63ce02cda81950987fa0cdbea610</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>fixes load_text</title>
<updated>2013-06-17T05:51:20+00:00</updated>
<author>
<name>Peng Wu</name>
<email>alexepico@gmail.com</email>
</author>
<published>2013-06-17T05:45:56+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/pwu/public_git/libpinyin.git/commit/?id=fff35792df8d7ae0e65a20b2e507f7fabbd8becb'/>
<id>fff35792df8d7ae0e65a20b2e507f7fabbd8becb</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>add const modifiers for phrase table</title>
<updated>2013-04-18T03:16:14+00:00</updated>
<author>
<name>Peng Wu</name>
<email>alexepico@gmail.com</email>
</author>
<published>2013-04-18T03:16:14+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/pwu/public_git/libpinyin.git/commit/?id=0ee1b6a1b63ae2d55684bd982a95a6a9389f12d2'/>
<id>0ee1b6a1b63ae2d55684bd982a95a6a9389f12d2</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
