Coder Social home page Coder Social logo

Clang 14 and 15 build error about asio-grpc HOT 11 CLOSED

tradias avatar tradias commented on May 17, 2024
Clang 14 and 15 build error

from asio-grpc.

Comments (11)

Tradias avatar Tradias commented on May 17, 2024 1

Oh the recycling_allocator is part of Asio, which means it is also available in standalone asio: https://think-async.com/Asio/asio-1.24.0/doc/asio/reference/recycling_allocator/recycling_allocator.html

from asio-grpc.

Tradias avatar Tradias commented on May 17, 2024

When using clang+libc++ you can tell asio-grpc to utilize Boost.Container instead of <memory_resource>. See Usage in the README. For example, vcpkg with standalone asio would look like this:

{
    "$schema": "https://raw.githubusercontent.com/microsoft/vcpkg/master/scripts/vcpkg.schema.json",
    "name": "test",
    "version": "0.1.0",
    "dependencies": [
        {
            "name": "asio-grpc",
            "features": [
                "boost-container"
            ]
        },
        "asio"
    ]
}

from asio-grpc.

ivan-volnov avatar ivan-volnov commented on May 17, 2024

Thanks, I have seen it. But I hoped to use it without Boost. Purely with standalone asio. May be add another option for experimental prefix?

from asio-grpc.

Tradias avatar Tradias commented on May 17, 2024

Sure, I can look into it. experimental/memory_resource won't work however, because it does not contain unsynchronized_pool_resource. I could use something like recycling_allocator instead.

from asio-grpc.

ivan-volnov avatar ivan-volnov commented on May 17, 2024

Yes, you are right, experimental/memory_resource doesn't contain unsynchronized_pool_resource.

Unfortunately recycling_allocator is not a big deal either because of Boost dependency.

Will look for another workaround.

Tried to update clang to 15. No luck.

The work on memory_resource has been abandoned in clang:
https://quuxplusone.github.io/blog/2018/06/05/libcpp-memory-resource/

from asio-grpc.

ivan-volnov avatar ivan-volnov commented on May 17, 2024

Well, it would be great! Looking forward for the commit =)

from asio-grpc.

Tradias avatar Tradias commented on May 17, 2024

Master branch now contains an option to enable the use of recycling_allocator:

set(ASIO_GRPC_USE_RECYCLING_ALLOCATOR on)
set(ASIO_GRPC_USE_BOOST_CONTAINER off)

add_subdirectory(/path/to/repository/root)

from asio-grpc.

Tradias avatar Tradias commented on May 17, 2024

Version 2.4.0 has been released containing this feature. I also simplified it such that

set(ASIO_GRPC_USE_RECYCLING_ALLOCATOR on)
add_subdirectory(/path/to/repository/root)

should do the trick. Let me know if everything works as you expect.

from asio-grpc.

Tradias avatar Tradias commented on May 17, 2024

Hi @ivan-volnov,

have you found some time to test the new feature, does it work as you expect? If so, could you close the issue please?

from asio-grpc.

ivan-volnov avatar ivan-volnov commented on May 17, 2024

Hi @Tradias,

Thank you very much for fixing the issue.

I ended up with writing my own small one-file implementation of the library using your old blog post. Thanks a lot for this!

So, I can't test it anymore...
I don't use the code I don't understand or that has a lot of redundant stuff.

My recommendations are: refactor the library, make it small and easy as possible.

from asio-grpc.

Tradias avatar Tradias commented on May 17, 2024

Glad to hear that my blog post was helpful.

In the immediate future I plan on adding a Tutorial section to the documentation, but aimed at users more than maintainers. Nonetheless, it might shed some light on the complexity in some parts of the library. For v3 I also plan on removing some parts of the public API and simplify things like repeatedly_request.
With libraries it is always a tricky dance between genericity and focus.

from asio-grpc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.