Skip to content
This repository was archived by the owner on Nov 6, 2022. It is now read-only.

Commit b6191fa

Browse files
faernJethro Beekman
and
Jethro Beekman
committed
Update RWLOCK_INIT with new parking_lot based value
Co-authored-by: Jethro Beekman <[email protected]>
1 parent 53b5863 commit b6191fa

File tree

1 file changed

+5
-19
lines changed

1 file changed

+5
-19
lines changed

libunwind/src/UnwindRustSgx.h

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -21,29 +21,15 @@
2121
#include <stdint.h>
2222

2323
// We have to use RWLock from rust repo, it is defined in:
24-
// src/libstd/sys/sgx/rwlock.rs.
25-
// rwlock.rs has compile time check to ensure sizeof(RWLock) = 128.
24+
// src/libstd/sys/sgx/unwind.rs.
25+
// unwind.rs has compile time check to ensure sizeof(RWLock) = 16.
2626
typedef struct {
27-
unsigned char opaque[128];
28-
} RWLock;
27+
unsigned char opaque[16];
28+
} __attribute__ ((aligned (8))) RWLock;
2929

3030
// The below is obtained by printing initialized bytes
31-
// for RWLock in rust repo: src/libstd/sys/sgx/rwlock.rs.
31+
// for RWLock in rust repo: src/libstd/sys/sgx/unwind.rs.
3232
#define RWLOCK_INIT { \
33-
0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, \
34-
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, \
35-
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, \
36-
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, \
37-
0x3, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, \
38-
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, \
39-
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, \
40-
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, \
41-
0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, \
42-
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, \
43-
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, \
44-
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, \
45-
0x3, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, \
46-
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, \
4733
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, \
4834
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, \
4935
}

0 commit comments

Comments
 (0)