Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Macros
SkAttributes.h File Reference
#include "include/private/base/SkFeatures.h"
#include "include/private/base/SkLoadUserConfig.h"

Go to the source code of this file.

Macros

#define SK_ATTRIBUTE(attr)
 
#define SK_ALWAYS_INLINE   SK_ATTRIBUTE(always_inline) inline
 
#define SK_NEVER_INLINE   SK_ATTRIBUTE(noinline)
 
#define SK_PRINTF_LIKE(A, B)   SK_ATTRIBUTE(format(printf, (A), (B)))
 
#define SK_NO_SANITIZE(A)   SK_ATTRIBUTE(no_sanitize(A))
 
#define SK_CLANG_NO_SANITIZE(A)
 
#define SK_TRIVIAL_ABI
 

Macro Definition Documentation

◆ SK_ALWAYS_INLINE

#define SK_ALWAYS_INLINE   SK_ATTRIBUTE(always_inline) inline

If your judgment is better than the compiler's (i.e. you've profiled it), you can use SK_ALWAYS_INLINE to force inlining. E.g. inline void someMethod() { ... } // may not be inlined SK_ALWAYS_INLINE void someMethod() { ... } // should always be inlined

Definition at line 30 of file SkAttributes.h.

◆ SK_ATTRIBUTE

#define SK_ATTRIBUTE (   attr)

Definition at line 17 of file SkAttributes.h.

◆ SK_CLANG_NO_SANITIZE

#define SK_CLANG_NO_SANITIZE (   A)

Helper macro to define no_sanitize attributes only with clang.

Definition at line 72 of file SkAttributes.h.

◆ SK_NEVER_INLINE

#define SK_NEVER_INLINE   SK_ATTRIBUTE(noinline)

If your judgment is better than the compiler's (i.e. you've profiled it), you can use SK_NEVER_INLINE to prevent inlining.

Definition at line 42 of file SkAttributes.h.

◆ SK_NO_SANITIZE

#define SK_NO_SANITIZE (   A)    SK_ATTRIBUTE(no_sanitize(A))

Used to ignore sanitizer warnings.

Definition at line 59 of file SkAttributes.h.

◆ SK_PRINTF_LIKE

#define SK_PRINTF_LIKE (   A,
  B 
)    SK_ATTRIBUTE(format(printf, (A), (B)))

Used to annotate a function as taking printf style arguments. A is the (1 based) index of the format string argument. B is the (1 based) index of the first argument used by the format string.

Definition at line 52 of file SkAttributes.h.

◆ SK_TRIVIAL_ABI

#define SK_TRIVIAL_ABI

Annotates a class' non-trivial special functions as trivial for the purposes of calls. Allows a class with a non-trivial destructor to be __is_trivially_relocatable. Use of this attribute on a public API breaks platform ABI. Annotated classes may not hold pointers derived from this. Annotated classes must implement move+delete as equivalent to memcpy+free. Use may require more complete types, as callee destroys.

https://clang.llvm.org/docs/AttributeReference.html#trivial-abi https://libcxx.llvm.org/DesignDocs/UniquePtrTrivialAbi.html

Definition at line 87 of file SkAttributes.h.