using allocator for bson#4167
Conversation
🔴 Amalgamation check failed! 🔴The source code has not been amalgamated. @alexfishgait1234 |
|
@alexfishgait1234 You made your changes in the |
nlohmann
left a comment
There was a problem hiding this comment.
- Please amalgamate.
- Please add a proper description of the changes. Why are they needed? What is the benefit?
- Please add a test case using the allocator and the string type.
|
Hoi.thanks a lot for writing. Sorry for the mess.i wanted to create pull
request in our forked local repo in order to test it but by mistake did it
for your develop.its still draft of course. We want to use bson format
without any memory allocation with our real-time string and allocator.i
found all places where this allocator support is missing and trying to
implement it.this lib is really greater and we want to integrate it in our
real time product.thanks a lot .alex
…On Fri, Sep 29, 2023, 17:31 Niels Lohmann ***@***.***> wrote:
***@***.**** requested changes on this pull request.
- Please amalgamate.
- Please add a proper description of the changes. Why are they needed?
What is the benefit?
- Please add a test case using the allocator and the string type.
—
Reply to this email directly, view it on GitHub
<#4167 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AODNI3FSYIBLO3STSUFCEJTX43SVVANCNFSM6AAAAAA5MKXRBQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
🔴 Amalgamation check failed! 🔴The source code has not been amalgamated. @alexfishgait1234 |
|
how can i remove single_include/hnohmann/json.hpp from pull request please? |
🔴 Amalgamation check failed! 🔴The source code has not been amalgamated. @alexfishgait1234 |
🔴 Amalgamation check failed! 🔴The source code has not been amalgamated. @alexfishgait1234 |
|
This pull request has been marked as stale because it has had no activity for 30 days. While we won’t close it automatically, we encourage you to update or comment if it is still relevant. Keeping pull requests active and up-to-date helps us review and merge changes more efficiently. Thank you for your contributions! |
[Describe your pull request here. Please read the text below the line, and make sure you follow the checklist.]
we need some json functionality completely without any memory allocations. That means passing allocators als template parameter to different classes: parser,binary_reader,inputadapter,sax_dom_parser,lexer.
json functions that need to use custom memory allocator: to_bson;from_bson;parse.
Some std containers in lib are not allocator aware:
-std::vector<char_type> token_string - lexer
-std::vector<BasicJsonType*> ref_stack - json_sax.hpp
we need 2 types of allocator as template parameter : basic_json* and char_type(char)
there are also make_shared ptr in output adapter which should be replaced with allocate_shared.
some other minor conversions functions which allocate.
usage from our client code will be as follows:
namespace rtjson {
using json = nlohmann::basic_json<std::map,
std::vector,
sqp::core::rtutils::RtString, //use rtstring
bool,
long long,
unsigned long long,
double,
sqp::core::memory::PolymorphicAllocator, //use polymorpic allocator
} // namespace ext
using json = rtjson::json;
Pull request checklist
Read the Contribution Guidelines for detailed information.
include/nlohmanndirectory, runmake amalgamateto create the single-header filessingle_include/nlohmann/json.hppandsingle_include/nlohmann/json_fwd.hpp. The whole process is described here.Please don't
#ifdefs or other means.