-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Do not reference SecureAllocator when not JSONCPP_USING_SECURE_MEMORY #872
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
6622c9d
to
46acbc8
Compare
LGTM, but I'm going to let other have a chance to weigh in. |
if you use amalgamated version then it would have this code:
but there would be no |
I think we should add allocator.h to amalgamated. I would much rather use in-language C++ tools like std::conditional whenever we can. Pavel thanks for the hint about amalgamated being the key issue here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't agree with this direction.
We should just add allocator.h to the amalgamated distro.
@@ -173,11 +173,11 @@ typedef UInt64 LargestUInt; | |||
#define JSON_HAS_INT64 | |||
#endif // if defined(JSON_NO_INT64) | |||
|
|||
template <typename T> | |||
using Allocator = typename std::conditional<JSONCPP_USING_SECURE_MEMORY, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should still have a Json::Allocator
alias template.
If there's fancy conditional or #if tap dancing to calculate the Allocator alias, let's have it contained to the Allocator declaration and not infect things like Json::String. The definition of Json::String should just use Json::Allocator unconditionally.
…d header. I don't know why we didn't include this before. It seems to work fine.
46acbc8
to
2874474
Compare
Amalgamated version of jsoncpp does not include allocator.h and as a result doesn't have definition of SecureAllocator and results in compilation error when referencing SecureAllocator in config.h
2874474
to
0a01f3d
Compare
I don't know why we didn't include this before. It seems to work fine.
@BillyDonahue Are you happy with this improvement? Can it be merged, or should it be abandoned? |
Adding json/allocator.h in the amalgamated header seems to have resolved this issue in an alterantive way. Closing this issue. Please re-open if other issues exist. |
Amalgamated version of jsoncpp does not include allocator.h and as a result doesn't have definition of SecureAllocator and results in compilation error when referencing SecureAllocator in config.h
this issue is mentioned in #871