Skip to content

Commit

Permalink
Merge pull request Tencent#2008 from agate-pris/access-to-allocator-t…
Browse files Browse the repository at this point in the history
…ypes

Access to allocator types
  • Loading branch information
miloyip authored Apr 6, 2022
2 parents bdc49ad + 386d31a commit fcb23c2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions include/rapidjson/document.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class GenericDocument;
User can define this to use CrtAllocator or MemoryPoolAllocator.
*/
#ifndef RAPIDJSON_DEFAULT_ALLOCATOR
#define RAPIDJSON_DEFAULT_ALLOCATOR MemoryPoolAllocator<CrtAllocator>
#define RAPIDJSON_DEFAULT_ALLOCATOR ::RAPIDJSON_NAMESPACE::MemoryPoolAllocator<::RAPIDJSON_NAMESPACE::CrtAllocator>
#endif

/*! \def RAPIDJSON_DEFAULT_STACK_ALLOCATOR
Expand All @@ -85,7 +85,7 @@ class GenericDocument;
User can define this to use CrtAllocator or MemoryPoolAllocator.
*/
#ifndef RAPIDJSON_DEFAULT_STACK_ALLOCATOR
#define RAPIDJSON_DEFAULT_STACK_ALLOCATOR CrtAllocator
#define RAPIDJSON_DEFAULT_STACK_ALLOCATOR ::RAPIDJSON_NAMESPACE::CrtAllocator
#endif

/*! \def RAPIDJSON_VALUE_DEFAULT_OBJECT_CAPACITY
Expand Down Expand Up @@ -2486,6 +2486,7 @@ class GenericDocument : public GenericValue<Encoding, Allocator> {
typedef typename Encoding::Ch Ch; //!< Character type derived from Encoding.
typedef GenericValue<Encoding, Allocator> ValueType; //!< Value type of the document.
typedef Allocator AllocatorType; //!< Allocator type from template parameter.
typedef StackAllocator StackAllocatorType; //!< StackAllocator type from template parameter.

//! Constructor
/*! Creates an empty document of specified type.
Expand Down

0 comments on commit fcb23c2

Please sign in to comment.