Giter Site home page Giter Site logo

Comments (8)

qicosmos avatar qicosmos commented on May 18, 2024 1

I think we need to check if there are more union UB code.

from async_simple.

qicosmos avatar qicosmos commented on May 18, 2024

Shell we use std::variant instead of union? however maybe visiting union is more efficient.

from async_simple.

ChuanqiXu9 avatar ChuanqiXu9 commented on May 18, 2024

I think we need to check if there are more union UB code.

Of course, it is always good to eliminate UB.

Shell we use std::variant instead of union? however maybe visiting union is more efficient.

I think the readability and maintainability is more important given it wouldn't hurt performance much. @RainMark how do you think about?

from async_simple.

RainMark avatar RainMark commented on May 18, 2024

the SimpleExecutor's ContextUnion looks like can be removed, static_cast void* to int64_t directly?

And the other tagged union keep it firstly?

from async_simple.

qicosmos avatar qicosmos commented on May 18, 2024

the SimpleExecutor's ContextUnion looks like can be removed, static_cast void* to int64_t directly?

And the other tagged union keep it firstly?

I think it's acceptable, but we should make sure no UB anymore.

from async_simple.

ChuanqiXu9 avatar ChuanqiXu9 commented on May 18, 2024

but we should make sure no UB anymore.

This is the right direction. But we couldn't make sure no UB actually : ) Some static analysis tool might help.

from async_simple.

qicosmos avatar qicosmos commented on May 18, 2024

I agree, union is not safe, we'd better use std::variant as safe union.

from async_simple.

ChuanqiXu9 avatar ChuanqiXu9 commented on May 18, 2024

Yeah, I agree std::variant is better. But given async_simple is based on practicing. Let's be conservative and refactor it step by step in stead of in one shot.

from async_simple.

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.