Closed Bug 538545 Opened 14 years ago Closed 14 years ago

Zeroing of strings table in AvmCore::AvmCore probably redundant

Categories

(Tamarin Graveyard :: Virtual Machine, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Future

People

(Reporter: lhansen, Assigned: stejohns)

References

Details

(Whiteboard: PACMAN)

Attachments

(1 file)

The code is this:

  strings = mmfx_new_array(DRC(Stringp), numStrings);
  VMPI_memset(strings, 0, numStrings*sizeof(DRC(Stringp)));

However, mmfx_new_array runs the constructor for each array element, and the DRC (really RCPtr<T>) constructor sets the memory to zero.  Ergo the memset is probably redundant (though it won't be redundant if DRC is a no-op, as it would be if refrerence counting were to be disabled).
Probably DRC() can't ever be a no-op, even if RC is disabled, precisely for this reason.
Whiteboard: PACMAN
See Also: → 596207
Attached patch PatchSplinter Review
Assignee: nobody → stejohns
Attachment #477625 - Flags: review?(lhansen)
Attachment #477625 - Flags: review?(lhansen) → review+
http://hg.mozilla.org/tamarin-redux/rev/9ea03c79e169
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: