From 69fa74ef54e845a22a877942b0d5876bee03c94e Mon Sep 17 00:00:00 2001 From: Jacek Sieka Date: Wed, 20 Jul 2022 10:01:12 +0200 Subject: [PATCH] barriers: use bycopy simpler mapping that corresponds to c2nim --- taskpools/primitives/barriers_posix.nim | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/taskpools/primitives/barriers_posix.nim b/taskpools/primitives/barriers_posix.nim index d85f223..96a5f06 100644 --- a/taskpools/primitives/barriers_posix.nim +++ b/taskpools/primitives/barriers_posix.nim @@ -18,10 +18,10 @@ when defined(osx): export PthreadBarrierAttr, PthreadBarrier, Errno, PTHREAD_BARRIER_SERIAL_THREAD else: type - PthreadBarrierAttr* {.importc: "pthread_barrierattr_t", header: "", byref.} = object + PthreadBarrierAttr* {.importc: "pthread_barrierattr_t", header: "", bycopy.} = object when (defined(linux) and not defined(android)) and defined(amd64): abi: array[4 div sizeof(cint), cint] # https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/x86/nptl/bits/pthreadtypes-arch.h;h=dd06d6753ebc80d94ede6c3c18227a3ad3104570;hb=HEAD#l45 - PthreadBarrier* {.importc: "pthread_barrier_t", header: "", byref.} = object + PthreadBarrier* {.importc: "pthread_barrier_t", header: "", bycopy.} = object when (defined(linux) and not defined(android)) and defined(amd64): abi: array[32 div sizeof(clong), clong] # https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/x86/nptl/bits/pthreadtypes-arch.h;h=dd06d6753ebc80d94ede6c3c18227a3ad3104570;hb=HEAD#l28 @@ -39,7 +39,7 @@ else: # one in barriers_macos # see https://github.com/status-im/nim-taskpools/pull/20#discussion_r923843093 proc pthread_barrier_init*( - barrier: PthreadBarrier, + barrier: var PthreadBarrier, attr: ptr PthreadBarrierAttr, count: cuint ): Errno {.header: "".} @@ -48,7 +48,7 @@ else: # TODO the macos signature is var instead of sink proc pthread_barrier_destroy*( - barrier: sink PthreadBarrier): Errno {.header: "".} + barrier: var PthreadBarrier): Errno {.header: "".} ## Destroy a previously dynamically initialized `barrier`. proc pthread_barrier_wait*(