LibreOffice Module onlineupdate (master) 1
Macros
Attributes.h File Reference
#include "Compiler.h"
Include dependency graph for Attributes.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define MOZ_ALWAYS_INLINE_EVEN_DEBUG   inline
 
#define MOZ_ALWAYS_INLINE   inline
 
#define MOZ_CONSTEXPR   /* no support */
 
#define MOZ_CONSTEXPR_VAR   const
 
#define MOZ_CONSTEXPR_TMPL
 
#define MOZ_EXPLICIT_CONVERSION   /* no support */
 
#define MOZ_NEVER_INLINE   /* no support */
 
#define MOZ_NORETURN   /* no support */
 
#define MOZ_COLD
 MOZ_COLD tells the compiler that a function is "cold", meaning infrequently executed. More...
 
#define MOZ_NONNULL(...)
 MOZ_NONNULL tells the compiler that some of the arguments to a function are known to be non-null. More...
 
#define MOZ_PRETEND_NORETURN_FOR_STATIC_ANALYSIS   /* no support */
 
#define MOZ_ASAN_DENYLIST   /* nothing */
 
#define MOZ_TSAN_DENYLIST   /* nothing */
 
#define MOZ_ALLOCATOR
 MOZ_ALLOCATOR tells the compiler that the function it marks returns either a "fresh", "pointer-free" block of memory, or nullptr. More...
 
#define MOZ_WARN_UNUSED_RESULT
 MOZ_WARN_UNUSED_RESULT tells the compiler to emit a warning if a function's return value is not used by the caller. More...
 

Macro Definition Documentation

◆ MOZ_ALLOCATOR

#define MOZ_ALLOCATOR

MOZ_ALLOCATOR tells the compiler that the function it marks returns either a "fresh", "pointer-free" block of memory, or nullptr.

"Fresh" means that the block is not pointed to by any other reachable pointer in the program. "Pointer-free" means that the block contains no pointers to any valid object in the program. It may be initialized with other (non-pointer) values.

Placing this attribute on appropriate functions helps GCC analyze pointer aliasing more accurately in their callers.

GCC warns if a caller ignores the value returned by a function marked with MOZ_ALLOCATOR: it is hard to imagine cases where dropping the value returned by a function that meets the criteria above would be intentional.

Place this attribute after the argument list and 'this' qualifiers of a function definition. For example, write

void *my_allocator(size_t) MOZ_ALLOCATOR;

or

void *my_allocator(size_t bytes) MOZ_ALLOCATOR { ... }

Definition at line 312 of file Attributes.h.

◆ MOZ_ALWAYS_INLINE

#define MOZ_ALWAYS_INLINE   inline

Definition at line 37 of file Attributes.h.

◆ MOZ_ALWAYS_INLINE_EVEN_DEBUG

#define MOZ_ALWAYS_INLINE_EVEN_DEBUG   inline

Definition at line 29 of file Attributes.h.

◆ MOZ_ASAN_DENYLIST

#define MOZ_ASAN_DENYLIST   /* nothing */

Definition at line 267 of file Attributes.h.

◆ MOZ_COLD

#define MOZ_COLD

MOZ_COLD tells the compiler that a function is "cold", meaning infrequently executed.

This may lead it to optimize for size more aggressively than speed, or to allocate the body of the function in a distant part of the text segment to help keep it from taking up unnecessary icache when it isn't in use.

Place this attribute at the very beginning of a function definition. For example, write

MOZ_COLD int foo();

or

MOZ_COLD int foo() { return 42; }

Definition at line 206 of file Attributes.h.

◆ MOZ_CONSTEXPR

#define MOZ_CONSTEXPR   /* no support */

Definition at line 126 of file Attributes.h.

◆ MOZ_CONSTEXPR_TMPL

#define MOZ_CONSTEXPR_TMPL

Definition at line 128 of file Attributes.h.

◆ MOZ_CONSTEXPR_VAR

#define MOZ_CONSTEXPR_VAR   const

Definition at line 127 of file Attributes.h.

◆ MOZ_EXPLICIT_CONVERSION

#define MOZ_EXPLICIT_CONVERSION   /* no support */

Definition at line 153 of file Attributes.h.

◆ MOZ_NEVER_INLINE

#define MOZ_NEVER_INLINE   /* no support */

Definition at line 165 of file Attributes.h.

◆ MOZ_NONNULL

#define MOZ_NONNULL (   ...)

MOZ_NONNULL tells the compiler that some of the arguments to a function are known to be non-null.

The arguments are a list of 1-based argument indexes identifying arguments which are known to be non-null.

Place this attribute at the very beginning of a function definition. For example, write

MOZ_NONNULL(1, 2) int foo(char *p, char *q);

Definition at line 222 of file Attributes.h.

◆ MOZ_NORETURN

#define MOZ_NORETURN   /* no support */

Definition at line 185 of file Attributes.h.

◆ MOZ_PRETEND_NORETURN_FOR_STATIC_ANALYSIS

#define MOZ_PRETEND_NORETURN_FOR_STATIC_ANALYSIS   /* no support */

Definition at line 244 of file Attributes.h.

◆ MOZ_TSAN_DENYLIST

#define MOZ_TSAN_DENYLIST   /* nothing */

Definition at line 283 of file Attributes.h.

◆ MOZ_WARN_UNUSED_RESULT

#define MOZ_WARN_UNUSED_RESULT

MOZ_WARN_UNUSED_RESULT tells the compiler to emit a warning if a function's return value is not used by the caller.

Place this attribute at the very beginning of a function definition. For example, write

MOZ_WARN_UNUSED_RESULT int foo();

or

MOZ_WARN_UNUSED_RESULT int foo() { return 42; }

Definition at line 331 of file Attributes.h.