Coder Social home page Coder Social logo

Comments (7)

SChernykh avatar SChernykh commented on June 9, 2024 1

Did you try to compile with #3461? Like I said, I can't reproduce your results.

Edit: it is, indeed, 16 bytes in g++. I'll look into it.

from xmrig.

SChernykh avatar SChernykh commented on June 9, 2024 1

#3462 should fix it.

from xmrig.

SChernykh avatar SChernykh commented on June 9, 2024

sizeof(p) is 8, and your code prints sizeof(p) 8 sizeof(engine)/256 8 when I compile it in MSVC. What compiler version did you use? Maybe you used some special compiler settings?

from xmrig.

SChernykh avatar SChernykh commented on June 9, 2024

In any case, this PR should make this a compile-time problem instead: #3461
If it compiles, you can be sure pointer sizes match.

from xmrig.

xcryptodigger avatar xcryptodigger commented on June 9, 2024

sizeof(p) is 8, and your code prints sizeof(p) 8 sizeof(engine)/256 8 when I compile it in MSVC. What compiler version did you use? Maybe you used some special compiler settings?

It is not only on MSVC.
When built on Ubuntu, g++ then it prints
sizeof(p) 16 sizeof(engine)/256 8
So it is also not correct and again memcpy spoils memory after engine array.

I noticed that because when my own JIT compiler implementation grows with code then sometimes it works and sometimes does not work just because unpredictable behave. And seem reason is those handler pointers.

from xmrig.

xcryptodigger avatar xcryptodigger commented on June 9, 2024

Thank You!
Seems now fixed.
PS: Someone can explain why compilers can reserve too much bytes per simple pointer? I have no idea why..

from xmrig.

SChernykh avatar SChernykh commented on June 9, 2024

I found this article on the topic: https://devblogs.microsoft.com/oldnewthing/20040209-00/?p=40713

from xmrig.

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.