-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
no warning if I/O buffer too small in pipe #17
Comments
this also fails, but it seem fitsio cannot handle files > 4GB |
Converted the filestruct code to using off_t and size_t an odd (compiler?) bug came up where the following seemingly legal code failed to stop the while loop:
whereas the following code ran fine:
maybe I need another eye on this @jcldc ??? Happy newyear JC ! Code is still in the "issue17" branch, not merged to master yet. |
All of the examples given above now seem to work, except scanfits on huge fits files fails. fitshead works fine though. This must be an unrelated and scanfits specific error due to some never converted 32/64 bit code. |
scanfits and the fits library module also needed a patch for using size_t instead of int. All example now workingl. |
Hi Peter,
|
Actually, if arithmetic underflow occurs, such as when decrementing past zero, all bits in size_t flip to one, representing the maximum unsigned value, not a negative number. |
I have updated the example code above, to display the real unsigned int value of len : |
ah, indeed, i need to change the %ld to %lu in the code! In Issue 17 was merged already, so I''ll do that in the master branch. |
I benchmarked the while() and for() loop, using the intel timers(3NEMO) routines. For small values of the array (say < 1e4) for() is just a tad slower than while(), but for much larger values of the array, the while() loop can be 2-3 times faster. |
In this example:
fitsccd tmp1.fits - | ccdstat -
for small files this works, as long as the file fits in memory, but there is no warning if not. then ccdstat will just report a 0 data array. Not good.
This should not happen, as filestruct allocated all data in memory when coming from pipe.
The text was updated successfully, but these errors were encountered: