Move alignment stuff out of Util.h

RESOLVED FIXED in mozilla26

Status

()

defect
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: Ms2ger, Assigned: Ms2ger)

Tracking

Trunk
mozilla26
Points:
---
Dependency tree / graph
Bug Flags:
in-testsuite -

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

No description provided.
Attachment #789023 - Flags: review?(jwalden+bmo)
Comment on attachment 789023 [details] [diff] [review]
Alignment-header

Review of attachment 789023 [details] [diff] [review]:
-----------------------------------------------------------------

::: js/src/jit/BaselineFrameInfo.h
@@ +11,5 @@
>  
>  #include "jscntxt.h"
>  #include "jscompartment.h"
>  
> +#include "mozilla/Alignment.h"

This should go above the "jscntxt.h" #include, per <https://wiki.mozilla.org/JavaScript:SpiderMonkey:Coding_Style>.

::: mfbt/Alignment.h
@@ +3,5 @@
> +/* This Source Code Form is subject to the terms of the Mozilla Public
> + * License, v. 2.0. If a copy of the MPL was not distributed with this
> + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
> +
> +/* Functionality related to memory alignment */

Looks like precedent should have this with a period at end.

@@ +14,5 @@
> +
> +namespace mozilla {
> +
> +/*
> + * This class, and the corresponding macro MOZ_ALIGNOF, figures out how many 

trailing whitespace

@@ +59,5 @@
> + * bytes.
> + *
> + * We support 1, 2, 4, 8, and 16-bit alignment.
> + */
> +template<size_t align>

Align, please, per STYLE.

@@ +107,5 @@
> + * enough obfuscation to confuse gcc's strict-aliasing analysis into not giving
> + * false negatives when we cast from the char buffer to whatever type we've
> + * constructed using the bytes.
> + */
> +template<size_t nbytes>

Nbytes

@@ +119,5 @@
> +    const void* addr() const { return u.bytes; }
> +    void* addr() { return u.bytes; }
> +};
> +
> +template<class T>

typename T
Attachment #789023 - Flags: review?(jwalden+bmo) → review+
Assignee

Comment 2

6 years ago
https://hg.mozilla.org/mozilla-central/rev/ce2910a5da00
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Flags: in-testsuite-
Resolution: --- → FIXED
Target Milestone: --- → mozilla26
You need to log in before you can comment on or make changes to this bug.