mirror of
https://github.com/Tencent/rapidjson.git
synced 2025-03-06 13:41:35 +01:00
Merge pull request #1082 from svart-riddare/regex-allocator
Use schema allocator for regex
This commit is contained in:
commit
d5c1be5a0f
@ -935,7 +935,7 @@ private:
|
||||
};
|
||||
|
||||
#if RAPIDJSON_SCHEMA_USE_INTERNALREGEX
|
||||
typedef internal::GenericRegex<EncodingType> RegexType;
|
||||
typedef internal::GenericRegex<EncodingType, AllocatorType> RegexType;
|
||||
#elif RAPIDJSON_SCHEMA_USE_STDREGEX
|
||||
typedef std::basic_regex<Ch> RegexType;
|
||||
#else
|
||||
@ -995,7 +995,7 @@ private:
|
||||
template <typename ValueType>
|
||||
RegexType* CreatePattern(const ValueType& value) {
|
||||
if (value.IsString()) {
|
||||
RegexType* r = new (allocator_->Malloc(sizeof(RegexType))) RegexType(value.GetString());
|
||||
RegexType* r = new (allocator_->Malloc(sizeof(RegexType))) RegexType(value.GetString(), allocator_);
|
||||
if (!r->IsValid()) {
|
||||
r->~RegexType();
|
||||
AllocatorType::Free(r);
|
||||
|
Loading…
x
Reference in New Issue
Block a user