Comments (5)
I implemented it with the into_raw
and from_raw
and it works just the same.
When I analize the difference it seems to me, that it returns the same pointer.
from hour_glass.
That is true today. It relies on the internal representation of Box<T>
, however, which is not guaranteed to remain the same in the future.
from hour_glass.
This is a good point, so it is ok to use the pointer directly like in this?: https://github.com/dns2utf8/hour_glass/blob/master/src/lib.rs#L35
from hour_glass.
The risk you face there is that the C code could pass a null pointer and you would end up with undefined behaviour, since LLVM optimizes code assuming those pointers could never be null.
from hour_glass.
Ah, well that is ok. As long as the user uses C++ that case should never occure thanks to @fmorgner for implementing the facade with std::unique_ptr
from hour_glass.
Related Issues (1)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hour_glass.