Comments (4)
Very interesting. I'm on x64 and all tests pass. Let me take a closer look.
from hdf.pinvoke.
Please pull the latest version. Everything passes for me on x86 and x64. Please confirm.
from hdf.pinvoke.
Now all tests pass for me, too.
Redeclaring the operator_t
type to take an IntPtr
is surely correct.
What I consider still dangerous, is that GCHandle.Alloc()
without the Pinned flag allows the GC still to move the allocated object around (which could happen any time).
From my point of view, something like this would be bulletproof:
GCHandle hnd = GCHandle.Alloc(aObj, GCHandleType.Pinned);
IntPtr aAdr = hnd.AddrOfPinnedObject();
H5A.iterate(...,cb, aAdr);
hnd.Free();
The downside of this is, that you cannot "pin" interesting .NET objects (like collections). But with the current declaration of the callback-function, it's completely up to the user, what she is passing in to the callback, so it's fine...
from hdf.pinvoke.
I would like to believe that I read somewhere that when passing a PInvoke boundary, the runtime automatically pins those handles. Maybe just wishful thinking... I'll close it for now and re-open as needed. There's another batch of callback APIs coming...
from hdf.pinvoke.
Related Issues (20)
- Fix the documentation link in the 1.8.x series of packages
- Hdf5DotnetWrapper: a C# wrapper for h5 files HOT 1
- Can't read compound dataset with struct fields Sbyte and Float HOT 10
- Support HDF5 1.12 HOT 12
- Question: Iterate of each attribute of object and print its information #17
- Question: Call to list all open objects and how to close all of them? #18 HOT 2
- H5D(O) [read/write]_chunk incorrect function arguments? HOT 1
- [Question] How to use H5Z to set compressions and checksum HOT 2
- [Broken links] Some links are broken on the main page
- Memory leak issue when trying to open using H5O.open HOT 3
- NuGet binaries are all missing copyright/version information
- Alpine support HOT 1
- Doc comments HOT 2
- Typo?
- Thread safety? HOT 3
- Just SWIG it! (?)
- HDF.PInvoke for latest HDF version HOT 2
- Dependency on vcruntime140.dll HOT 3
- GetDllPathFromAppConfig Not Considering Existing Keys HOT 7
- CFD Error HOT 2
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 hdf.pinvoke.