-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
using allocator for bson #4167
base: develop
Are you sure you want to change the base?
using allocator for bson #4167
Conversation
🔴 Amalgamation check failed! 🔴The source code has not been amalgamated. @alexfishgait1234 |
@alexfishgait1234 You made your changes in the |
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.
- 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 |
[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/nlohmann
directory, runmake amalgamate
to create the single-header filessingle_include/nlohmann/json.hpp
andsingle_include/nlohmann/json_fwd.hpp
. The whole process is described here.Please don't
#ifdef
s or other means.