in reply to Re^5: XS: returning a 64-bit unsigned int?
in thread XS: returning a 64-bit unsigned int?
That is how it's done. A single SvGETMAGIC if you read a scalar, no matter how many times you read it. A single SvSETMAGIC if you write to a scalar, no matter how many times you write to it.
And if you're processing a real array containing a million real scalars, then that's 2 million redundant, time consuming function calls conditional tests.
Addition: Were it possible to perform a single test on the array to detect magic, it might be worth doing to allow me to gracefully reject it. But as is, the only sensible option is to document that only real arrays of real scalars are acceptable input and fail noisily if I am given anything else.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^7: XS: returning a 64-bit unsigned int?
by ikegami (Patriarch) on Sep 27, 2011 at 18:00 UTC | |
by BrowserUk (Patriarch) on Sep 27, 2011 at 18:09 UTC | |
by ikegami (Patriarch) on Sep 27, 2011 at 18:15 UTC | |
by BrowserUk (Patriarch) on Sep 27, 2011 at 18:39 UTC | |
by ikegami (Patriarch) on Sep 27, 2011 at 19:11 UTC | |
|