[PATCH] Documentation nits and fixes for Sv*_set() macros
[email protected] (Steve Peters) Thu, 26 May 2005 14:58:50 -0500
| Newsgroups | perl.perl5.porters,perl.ponie.dev |
|---|---|
| Message-ID | <[email protected]> |
--W/nzBZO5zC0uMSeA Content-Type: text/plain; charset=us-ascii Content-Disposition: inline The attached patch fixes a couple of nits in the documentation for the Sv*_set() macros. Also, I received a request for some additional information on why you would want to use the Sv*_set() over the Sv*X() macros with an lvalue assignment. The short answer is in the documentation now. The long answer is that currently, there is no difference. The code is nearly identical. The difference will come about in Ponie where it will be more efficient to use the Sv*_set() macros. The lvalue assignments will still work, but just more slowly. So, now you're thinking, "If it doesn't help me until Ponie comes out, why are we worring about it now?" Well, multiple reasons. First, it moves Ponie forward without really impacting the core. Second, it helps to alert module authors to the changes that will be coming. Finally, and most greedily, it helped me to understand how the core worked more than any single ticket ever could. Anyways onto our previously scheduled patch... Steve Peters [email protected] --W/nzBZO5zC0uMSeA Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="sv.h.diff" --- sv.h.old Tue May 24 12:43:36 2005 +++ sv.h Thu May 26 14:27:17 2005 @@ -642,31 +642,35 @@ Returns the stash of the SV. =for apidoc Am|void|SvIV_set|SV* sv|IV val -Set the value of the IV pointer in sv to val. +Set the value of the IV pointer in sv to val. It is possible to perform +the same function of this macro with an lvalue assignment to C<SvIVX>. +With future Perls, however, it will be more efficient to use +C<SvIV_set> instead of the lvalue assignment to C<SvIVX>. =for apidoc Am|void|SvNV_set|SV* sv|NV val -Set the value of the IV pointer in sv to val. +Set the value of the NV pointer in sv to val. See C<SvIV_set>. =for apidoc Am|void|SvPV_set|SV* sv|char* val -Set the value of the PV pointer in sv to val. +Set the value of the PV pointer in sv to val. See C<SvIV_set>. =for apidoc Am|void|SvUV_set|SV* sv|UV val -Set the value of the PV pointer in sv to val. +Set the value of the UV pointer in sv to val. See C<SvIV_set>. =for apidoc Am|void|SvRV_set|SV* sv|SV* val -Set the value of the RV pointer in sv to val. +Set the value of the RV pointer in sv to val. See C<SvIV_set>. =for apidoc Am|void|SvMAGIC_set|SV* sv|MAGIC* val -Set the value of the MAGIC pointer in sv to val. +Set the value of the MAGIC pointer in sv to val. See C<SvIV_set>. =for apidoc Am|void|SvSTASH_set|SV* sv|STASH* val -Set the value of the STASH pointer in sv to val. +Set the value of the STASH pointer in sv to val. See C<SvIV_set>. =for apidoc Am|void|SvCUR_set|SV* sv|STRLEN len -Set the current length of the string which is in the SV. See C<SvCUR>. +Set the current length of the string which is in the SV. See C<SvCUR> +and C<SvIV_set>.. =for apidoc Am|void|SvLEN_set|SV* sv|STRLEN len -Set the actual length of the string which is in the SV. +Set the actual length of the string which is in the SV. See C<SvIV_set>. =cut */ --W/nzBZO5zC0uMSeA--