Skip to content

Revert "https://bugs.swift.org/browse/SR-6812" #1693

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

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 2 additions & 10 deletions CoreFoundation/Base.subproj/CFRuntime.h
Original file line number Diff line number Diff line change
Expand Up @@ -195,31 +195,23 @@ typedef struct __CFRuntimeBase {
uintptr_t _cfisa;
uintptr_t _swift_rc;
// This is for CF's use, and must match _NSCFType layout
#if defined(__LP64__) || defined(__LLP64__)
_Atomic(uint64_t) _cfinfoa;
#else
_Atomic(uint32_t) _cfinfoa;
#endif
} CFRuntimeBase;

#if defined(__LP64__) || defined(__LLP64__)
#define INIT_CFRUNTIME_BASE(...) {0, _CF_CONSTANT_OBJECT_STRONG_RC, 0x0000000000000080ULL}
#else
#define INIT_CFRUNTIME_BASE(...) {0, _CF_CONSTANT_OBJECT_STRONG_RC, 0x00000080UL}
#endif

#else

typedef struct __CFRuntimeBase {
uintptr_t _cfisa;
#if defined(__LP64__) || defined(__LLP64__)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is suspect. Why are we touching Darwin’s definition of this structure?

Copy link
Contributor

@Kaiede Kaiede Sep 27, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because the PR this one reverts did as well.

The PR that this reverts was an incorrect attempted fix for Arm 32, which honestly just made things worse because _CFInfo just became even more unaligned with CFRuntimeBase. Hence the need to revert. (And @johnno1962 put in the correct fix to _swift_rc which fixed the alignment, clashing with this fix)

I'm fine removing this part out of the revert though. As you say, it is Darwin, and I'm more concerned about fixing the bad "fix" as it was originally applied for Linux.

#if __LP64__
_Atomic(uint64_t) _cfinfoa;
#else
_Atomic(uint32_t) _cfinfoa;
#endif
} CFRuntimeBase;

#if defined(__LP64__) || defined(__LLP64__)
#if __LP64__
#define INIT_CFRUNTIME_BASE(...) {0, 0x0000000000000080ULL}
#else
#define INIT_CFRUNTIME_BASE(...) {0, 0x00000080UL}
Expand Down
4 changes: 0 additions & 4 deletions CoreFoundation/String.subproj/CFString.h
Original file line number Diff line number Diff line change
Expand Up @@ -156,11 +156,7 @@ struct __CFConstStr {
struct {
uintptr_t _cfisa;
uintptr_t _swift_rc;
#if defined(__LP64__) || defined(__LLP64__)
uint64_t _cfinfoa;
#else
uint32_t _cfinfoa;
#endif
} _base;
uint8_t *_ptr;
#if defined(__LP64__) && defined(__BIG_ENDIAN__)
Expand Down