template bar() =
echo a
template foo() {.dirty.} =
let a = 5
bar()
foo()
echo a
I would expect exactly that behaviour. As templates a hygienic by default, we
need dirty pragma for foo() to make variable visible outside.
I'm trying to get a slice from an open array and there seems to be a type
mismatch error. Is there any way around this?
proc xxx(r: openarray[int]) =
processRow(r[0..9]) <- type mismatch
...
There's no guarantee that the problem that valgrind is reporting is the cause
of your bug of course.
Anyhow, the code in question looks to be this, in threadpool.nim:
proc nimSpawn3(fn: WorkerProc; data: pointer) {.compilerProc.} =
# implementation of 'spawn' that is used by t
I tried running your code under helgrind.
valgrind --tool=helgrind test
It reported a data race:
==24599==
==24599==
==24599== Possible data race during read of size 8 at 0x33B168 by thread #1
This doesn't work:
template bar() {.dirty.} =
echo a
template foo() =
let a = 5
bar()
foo()
but this does:
template bar() {.dirty.} =
echo a
template foo() {.dirty.} =
let a = 5
bar()
Hello,
I also got this error on OSX with an older Mac ( MacBookPro Late 2011). I got
this error too on the Linux partition (KDE Neon =~ Ubuntu 16.04) using clang
(oddly, gcc is fine).
The program is compiled with `-mavx2`, but the cpu of my Mac supports up to AVX
instructions. Depending on the
@jackmott I'm confused by your question. I thought that calls like
_InterlockedExchangeAddNoFence64() _were_ intrinsics, therefore, isn't that
what I'm already trying to do? (But failing for some unclear reason, since the
failure is at link time, where they should already have been "replaced") U
can you implement the same with intrinsics? That is generally the
recommendation from Microsoft now.
I have a SIMD project that does CPU feature detection and uses macros to
provide a nice SIMD api, and the sample app works for me on Windows, and Linux,
but a user has reported an issue on OSX:
[https://github.com/jackmott/nim_simd/issues/4](https://github.com/jackmott/nim_simd/issues/4)
I don'
Nim Compiler Version 0.17.3 (2017-10-25) [Linux: amd64]
Copyright (c) 2006-2017 by Andreas Rumpf
git hash: fa02ffaeba219ca3f259667d5161d30e47bb13e0
active boot switches: -d:release
* * *
Code:
import os except sleep
import posix, strutils
import threadpool
when i
geo555 you can pick packages from Artful Aardvark (the current stable release)
or Bionic Beaver. They both ship 0.17.2 and are imported from Debian. There is
also HTML documentation in the nim-doc package.
[https://launchpad.net/ubuntu/+source/nim](https://launchpad.net/ubuntu/+source/nim)
11 matches
Mail list logo