summaryrefslogtreecommitdiffstats
path: root/src/storage/ngram.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Fix libpinyin crash on ARMv7Matias Larsson2022-11-291-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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'
* Use abort function instead of assert macroPeng Wu2022-06-061-1/+1
|
* Use check_result macro in src directoryPeng Wu2022-06-011-14/+14
|
* fixes merge_single_gram functionPeng Wu2020-08-211-0/+2
|
* Copy the data when merge into single ngram.Weng Xuetian2020-08-181-4/+4
| | | | system and user single ngram might be invalidated later.
* update code licensePeng Wu2016-10-311-7/+6
|
* add copy parameter to single gram constructorPeng Wu2015-04-211-2/+5
|
* re-factor BigramPeng Wu2015-04-091-250/+0
|
* fixes berkeley db callsPeng Wu2013-06-181-1/+17
|
* write Bigram::mask_outPeng Wu2012-10-301-1/+52
|
* write SingleGram::mask_outPeng Wu2012-10-301-0/+47
|
* begin to write import iteratorPeng Wu2012-06-261-1/+1
|
* update commentsPeng Wu2012-03-161-3/+0
|
* add safe guardPeng Wu2012-02-291-2/+2
|
* fixes a typoPeng Wu2012-01-171-1/+1
|
* fixes compilePeng Wu2011-12-051-1/+2
|
* fixes merge single gramPeng Wu2011-12-051-6/+6
|
* add const modifiersPeng Wu2011-12-051-4/+5
|
* write merge single gramPeng Wu2011-12-051-1/+84
|
* fixes save_dbPeng Wu2011-10-271-1/+2
|
* fixes load_dbPeng Wu2011-10-271-7/+9
|
* fixes fsf addressPeng Wu2011-10-111-1/+1
|
* refine namespace pinyinPeng Wu2011-08-081-0/+2
|
* add flexible n-gram signature checkPeng Wu2011-05-031-1/+1
|
* add load/save bi-gram dbPeng Wu2011-04-201-14/+99
|
* add an assert to bi-gramPeng Wu2011-04-191-1/+1
|
* add more test casesPeng Wu2011-04-191-1/+2
|
* refine bigram loadPeng Wu2011-04-181-4/+4
|
* refine bi-gramPeng Wu2011-04-181-93/+60
|
* add insert/remove array item to flexible bi-gramPeng Wu2011-04-181-1/+1
|
* add insert/remove freq to bi-gramPeng Wu2011-04-181-14/+58
|
* refine codePeng Wu2011-04-061-4/+4
|
* refine codePeng Wu2011-04-021-4/+4
|
* add function retrieve_all.Peng Wu2010-08-181-0/+22
|
* rename to libpinyin in file headers.Peng Wu2010-08-031-3/+2
|
* import from pinyin.Peng Wu2010-08-031-0/+283