Closed Bug 1355406 Opened 8 years ago Closed 8 years ago

Change the type of MediaCacheStream::mPartialBlockBuffer to UniquePtr<uint8_t[]>

Categories

(Core :: Audio/Video: Playback, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
mozilla55
Tracking Status
firefox55 --- fixed

People

(Reporter: jwwang, Assigned: jwwang)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Since bug 969114 moves mPartialBlockBuffer to a separate heap allocation, we don't need int64_t for proper alignment (the memory return by malloc() is always properly aligned). Changing the type to UniquePtr<uint8_t[]> also saves some reinterpret_casts.
Assignee: nobody → jwwang
Priority: -- → P3
See Also: → 969114
Blocks: 1355409
Attachment #8857739 - Flags: review?(gsquelart)
Attachment #8857739 - Flags: review?(gsquelart) → review?(jyavenard)
Looks like Gerald is on vacation.
Comment on attachment 8857739 [details] Bug 1355406 - Change the type of MediaCacheStream::mPartialBlockBuffer to UniquePtr<uint8_t[]>. https://reviewboard.mozilla.org/r/129698/#review132832 ::: commit-message-efa44:4 (Diff revision 1) > +Bug 1355406 - Change the type of MediaCacheStream::mPartialBlockBuffer to UniquePtr<uint8_t[]>. > + > +Since bug 969114 moves mPartialBlockBuffer to a separate heap allocation, > +we don't need int64_t for proper alignment for the memory returned by What do you mean by alignment, memory alignement? If so that is not correct. jemalloc do not align data. AFAIK, only malloc on mac returns an aligned buffer If your changes rely on malloc returning a memory aligned block, then it wont work
https://reviewboard-hg.mozilla.org/gecko/rev/329adb8a4414f32e2f83ba79af06d288d7b25705#l2.16 MakeUnique<> invokes the new operator which returns a memory block which is at least int64_t aligned. Is that correct?
Flags: needinfo?(nfroyd)
I'm certain it is not aligned. It's platform specific, and more often than not, jemalloc does not align memory. Hence why we had to have things like AlignedBuffer. This was confirmed by :njn
Nah, AlignedBuffer is used for higher alignment requirement that is not provided by new/malloc like 32byte or 64byte alignment.
Flags: needinfo?(nfroyd)
Comment on attachment 8857739 [details] Bug 1355406 - Change the type of MediaCacheStream::mPartialBlockBuffer to UniquePtr<uint8_t[]>. https://reviewboard.mozilla.org/r/129698/#review132940
Attachment #8857739 - Flags: review?(jyavenard) → review+
Thanks!
Pushed by jwwang@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/3985a21e25a3 Change the type of MediaCacheStream::mPartialBlockBuffer to UniquePtr<uint8_t[]>. r=jya
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: