in reply to Re^5: Storable- long integer size
in thread Storable- long integer size
Why is it effectively insisting that longsize be the same - especially given that longsize typically differs between linux and windows ?
My guess is that its because no one who appreciates the difference between LP64 & LLP64 programming models has really looked at the code since it was ported to 64-bit.
The code simply makes no attempt at differentiation. The magic_check function from Storable.xs :
/* * magic_check * * Make sure the stored data we're trying to retrieve has been produce +d * on an ILP compatible system with the same byteorder. It croaks out +in * case an error is detected. [ILP = integer-long-pointer sizes] * Returns null if error is detected, &PL_sv_undef otherwise. * * Note that there's no byte ordering info emitted when network order +was * used at store time. */ static SV *magic_check(pTHX_ stcxt_t *cxt) { ... current = buf + c; /* sizeof(int) */ if ((int) *current++ != sizeof(int)) CROAK(("Integer size is not compatible")); /* sizeof(long) */ if ((int) *current++ != sizeof(long)) CROAK(("Long integer size is not compatible")); /* sizeof(char *) */ if ((int) *current != sizeof(char *)) CROAK(("Pointer size is not compatible")); if (use_NV_size) { /* sizeof(NV) */ if ((int) *++current != sizeof(NV)) CROAK(("Double size is not compatible")); } return &PL_sv_undef; /* OK */ }
(The comment could be read to suggest another, less generous, interpretation.)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^7: Storable- long integer size
by syphilis (Archbishop) on Oct 22, 2015 at 10:47 UTC | |
by BrowserUk (Patriarch) on Oct 22, 2015 at 11:17 UTC | |
by syphilis (Archbishop) on Oct 22, 2015 at 13:21 UTC | |
by BrowserUk (Patriarch) on Oct 23, 2015 at 09:48 UTC |