Going generic...

This commit is contained in:
Daniel Lemire 2020-06-22 16:25:11 -04:00
parent d6f056f266
commit a6cbf1f922
4 changed files with 6 additions and 6 deletions

View File

@ -107,7 +107,7 @@ WARN_UNUSED error_code dom_parser_implementation::stage1(const uint8_t *_buf, si
}
#include "generic/stage1/utf8_validator.h"
WARN_UNUSED bool implementation::validate_utf8(const char *buf, size_t len) const noexcept {
return simdjson::arm64::stage1::utf8_validate(buf,len);
return simdjson::arm64::stage1::generic_validate_utf8(buf,len);
}
} // namespace arm64
} // namespace simdjson

View File

@ -3,7 +3,7 @@ namespace stage1 {
* Validates that the string is actual UTF-8.
*/
template<class checker>
bool utf8_validate(const uint8_t * input, size_t length) {
bool generic_validate_utf8(const uint8_t * input, size_t length) {
checker c{};
buf_block_reader<64> reader(input, length);
while (reader.has_full_block()) {
@ -19,8 +19,8 @@ bool utf8_validate(const uint8_t * input, size_t length) {
return c.errors() == error_code::SUCCESS;
}
bool utf8_validate(const char * input, size_t length) {
return utf8_validate<utf8_checker>((const uint8_t *)input,length);
bool generic_validate_utf8(const char * input, size_t length) {
return generic_validate_utf8<utf8_checker>((const uint8_t *)input,length);
}
} // namespace stage1

View File

@ -95,7 +95,7 @@ WARN_UNUSED error_code dom_parser_implementation::stage1(const uint8_t *_buf, si
}
#include "generic/stage1/utf8_validator.h"
WARN_UNUSED bool implementation::validate_utf8(const char *buf, size_t len) const noexcept {
return simdjson::haswell::stage1::utf8_validate(buf,len);
return simdjson::haswell::stage1::generic_validate_utf8(buf,len);
}
} // namespace haswell
} // namespace simdjson

View File

@ -96,7 +96,7 @@ WARN_UNUSED error_code dom_parser_implementation::stage1(const uint8_t *_buf, si
}
#include "generic/stage1/utf8_validator.h"
WARN_UNUSED bool implementation::validate_utf8(const char *buf, size_t len) const noexcept {
return simdjson::westmere::stage1::utf8_validate(buf,len);
return simdjson::westmere::stage1::generic_validate_utf8(buf,len);
}
} // namespace westmere
} // namespace simdjson