-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Move SWIFT_RETURNS_NONNULL
and SWIFT_NODISCARD
attributes after the function name for exported functions.
#61473
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,8 +29,9 @@ namespace swift { | |
// Never returns nil. The returned memory is uninitialized. | ||
// | ||
// An "alignment mask" is just the alignment (a power of 2) minus 1. | ||
SWIFT_RETURNS_NONNULL SWIFT_NODISCARD SWIFT_RUNTIME_EXPORT | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. allevato:shuffle-clang-attributes |
||
void *swift_slowAlloc(size_t bytes, size_t alignMask); | ||
SWIFT_RUNTIME_EXPORT | ||
void *swift_slowAlloc SWIFT_RETURNS_NONNULL SWIFT_NODISCARD(size_t bytes, | ||
size_t alignMask); | ||
|
||
// If the caller cannot promise to zero the object during destruction, | ||
// then call these corresponding APIs: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -61,10 +61,10 @@ struct OpaqueValue; | |
/// | ||
/// POSSIBILITIES: The argument order is fair game. It may be useful | ||
/// to have a variant which guarantees zero-initialized memory. | ||
SWIFT_RETURNS_NONNULL SWIFT_NODISCARD SWIFT_RUNTIME_EXPORT | ||
HeapObject *swift_allocObject(HeapMetadata const *metadata, | ||
size_t requiredSize, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. allevato:shuffle-clang-attributes |
||
size_t requiredAlignmentMask); | ||
SWIFT_RUNTIME_EXPORT | ||
HeapObject *swift_allocObject SWIFT_RETURNS_NONNULL | ||
SWIFT_NODISCARD(HeapMetadata const *metadata, size_t requiredSize, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are you okay clang-format? |
||
size_t requiredAlignmentMask); | ||
|
||
/// Initializes the object header of a stack allocated object. | ||
/// | ||
|
@@ -117,8 +117,8 @@ BoxPair swift_makeBoxUnique(OpaqueValue *buffer, Metadata const *type, | |
size_t alignMask); | ||
|
||
/// Returns the address of a heap object representing all empty box types. | ||
SWIFT_RETURNS_NONNULL SWIFT_NODISCARD SWIFT_RUNTIME_EXPORT | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. allevato:shuffle-clang-attributes |
||
HeapObject* swift_allocEmptyBox(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. allevato:shuffle-clang-attributes There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. allevato:shuffle-clang-attributes There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. allevato:shuffle-clang-attributes |
||
SWIFT_RUNTIME_EXPORT | ||
HeapObject *swift_allocEmptyBox SWIFT_RETURNS_NONNULL SWIFT_NODISCARD(); | ||
|
||
/// Atomically increments the retain count of an object. | ||
/// | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
include/swift/Runtime/Heap.h