Zeroing of strings table in AvmCore::AvmCore probably redundant

RESOLVED FIXED in Future

Status

Tamarin
Virtual Machine
RESOLVED FIXED
8 years ago
8 years ago

People

(Reporter: Lars T Hansen, Assigned: Steven Johnson)

Tracking

unspecified
Future

Details

(Whiteboard: PACMAN)

Attachments

(1 attachment)

(Reporter)

Description

8 years ago
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).
(Reporter)

Comment 1

8 years ago
Probably DRC() can't ever be a no-op, even if RC is disabled, precisely for this reason.
Whiteboard: PACMAN
(Reporter)

Updated

8 years ago
See Also: → bug 596207
(Assignee)

Comment 2

8 years ago
Created attachment 477625 [details] [diff] [review]
Patch
Assignee: nobody → stejohns
Attachment #477625 - Flags: review?(lhansen)
(Reporter)

Updated

8 years ago
Attachment #477625 - Flags: review?(lhansen) → review+
(Assignee)

Comment 3

8 years ago
http://hg.mozilla.org/tamarin-redux/rev/9ea03c79e169
Status: NEW → RESOLVED
Last Resolved: 8 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.