-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
fixes Thread initializer for ARC/ORC on Macos #20368
Conversation
@@ -141,7 +141,7 @@ else: | |||
header: "<pthread.h>".} = cint | |||
else: | |||
type | |||
SysThread* {.importc: "pthread_t", header: "<sys/types.h>".} = object | |||
SysThread* {.importc: "pthread_t", header: "<sys/types.h>".} = int |
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.
posix.nim
uses int type for all platforms:
type
Pthread* {.importc: "pthread_t", header: "<sys/types.h>".} = int
Regarding the reason why it is specific to ARC/ORC is that ARC/ORC initializes the of frEmbedded:
# inheritance in C++ does not allow struct initialization: bug #18410
if not p.module.compileToCpp and optTinyRtti in p.config.globalOptions:
var tmp: TLoc
if mode == constructRefObj:
let objType = t.skipTypes(abstractInst+{tyRef})
rawConstExpr(p, newNodeIT(nkType, a.lode.info, objType), tmp)
linefmt(p, cpsStmts,
"#nimCopyMem((void*)$1, (NIM_CONST void*)&$2, sizeof($3));$n",
[rdLoc(a), rdLoc(tmp), getTypeDesc(p.module, objType, mapTypeChooser(a))])
else:
rawConstExpr(p, newNodeIT(nkType, a.lode.info, t), tmp)
genAssignment(p, a, tmp, {}) And typedef struct _opaque_pthread_t *__darwin_pthread_t; Either ARC/ORC doesn't use It should be related to #18844 |
Thanks for your hard work on this PR! Hint: mm: orc; threads: on; opt: speed; options: -d:release |
* fixes Thread initializer for ARC/ORC * another try * fix * use int
Otherwise