Branch: refs/heads/blead
  Home:   https://github.com/Perl/perl5
  Commit: 4e6679530776aad96c1aba6145256686ccdfb044
      
https://github.com/Perl/perl5/commit/4e6679530776aad96c1aba6145256686ccdfb044
  Author: Richard Leach <[email protected]>
  Date:   2025-10-10 (Fri, 10 Oct 2025)

  Changed paths:
    M class.c

  Log Message:
  -----------
  Perl_newSVobject - adjusted for the default values

`newSV_type(SVt_PVOBJ)` does the following initialization:
* `ObjectMAXFIELD(sv) = -1;`
* `ObjectFIELDS(sv) = NULL;`

This commit makes two changes to `Perl_newSVobject` reflecting that:

1. There's no need for `Perl_newSVobject` to set either of these fields
if `fieldcount` is zero, so that line is coverted into a DEBUGGING
assert()` and one added for `ObjectMAXFIELD(sv)` for completeness.

2. When `fieldcount` is non-zero, setting `ObjectMAXFIELD(sv)` prior to
the `Newx()` is more likely to result in the compiler realising that
it only needs to do one `ObjectMAXFIELD(sv)` STORE rather than two.



To unsubscribe from these emails, change your notification settings at 
https://github.com/Perl/perl5/settings/notifications

Reply via email to