Commit graph

219 commits

Author SHA1 Message Date
Vladiwostok
231ae8b68a
Fix D-Scanner linting issues (#9070)
* Fix UndocumentedDeclarationCheck linting issue

* Fix IfConstraintsIndentCheck linting issue

* Address feedback

* Fix publictests CI

* Fix old (libdparse) D-Scanner linting warn
2024-10-27 01:21:56 -07:00
Nick Treleaven
7a14c896dd
Fix Bugzilla 14138 - std.parallelism.task breaks @safety (#9033) 2024-07-29 06:45:40 +08:00
Steven Schveighoffer
0ec4f47130 Fix issue 24207 - make AbstractTask private so it's not inadvertently
accessible to users of Task.
2023-10-29 11:04:54 -04:00
Imperatorn
2458e8f82e Typo 2023-10-29 15:39:13 +01:00
Iain Buclaw
e89ca123e2 Merge remote-tracking branch 'upstream/stable' into merge_stable 2022-12-15 18:57:45 +00:00
Iain Buclaw
8e799c14dc std.math.exponential: Implement log/log2/log10 for double- and float-precision 2022-12-12 19:59:05 +01:00
Martin Kinkelin
5645d87eb1 Fix Issue 22745 - std.parallelism.parallel fails to process empty range on a single CPU 2022-12-01 10:49:17 +00:00
Iain Buclaw
2b5ab004b2 Add preliminary support for GNU/Hurd 2022-03-22 14:11:33 +00:00
Anton Curmanschii
de7ad2282e Fix a potential memory leak, typos
On line 2741, `if (nBytesNeeded < maxStack)` will force memory allocation in the case when `nBytesNeeded == maxStack` , even though it's not technically required, because the stack buffer can hold those bytes.
On line 2762 though, the check `if (nBytesNeeded > maxStack)` is slightly wrong then. If `nBytesNeeded == maxStack`, it would cause a memory leak.
The fix is to not allocate if they're equal.
2021-12-12 05:39:12 +00:00
Petar Kirov
dfaaf8fa53 Merge remote-tracking branch 'upstream/stable' into merge_stable 2021-11-09 10:30:28 +02:00
Ate Eskola
1d5d1822ed Fix issue 16705 - TaskPool.reduce did not work with non-default initializable ranges 2021-10-18 14:06:54 +03:00
Hiroki Noda
e9a5297836 Fix Issue 22340 - totalCPUs may not return accurate number of CPUs
bugzilla url: https://issues.dlang.org/show_bug.cgi?id=22340
2021-09-28 12:13:56 +00:00
berni44
b2019ebab0 Narrow imports of std.math in the rest of phobos. 2021-04-21 03:00:57 +02:00
Boris Carvajal
276053dd07
Remove a few uses of fully qualified names that rely on a DMD bug 2021-02-22 08:16:13 -03:00
Iain Buclaw
87e5ab73b8 std.parallelism: Use core.sys.platform.sys.sysctl module 2021-02-02 14:03:18 +01:00
Iain Buclaw
c6c8b12852 Implement missing OpenBSD ports in phobos 2021-02-01 18:46:54 +01:00
Bernhard Seckinger
9cb7755041 Replace approxEqual with isClose 2021-01-28 10:39:50 +01:00
Martin Kinkelin
1a459c5996 Get rid of std.conv.emplace[Ref](), use core[.internal].lifetime
The emplace() stuff was moved to druntime; for some reason, it's still
in Phobos.

I've diffed the two versions, and they are still almost identical (incl.
unittests); the druntime version appears to have seen some improvements
(e.g., forwarding r/lvalueness of the arguments) in the meantime.
2021-01-17 16:02:25 +01:00
Geod24
04f3979317 Replace 'Issue XXX' with Bugzilla links
Make the links clickable, as was done in the DMD repository.
Also avoids any ambiguity w.r.t. where the issue is stored.
2020-04-13 16:28:09 +09:00
Jacob Carlborg
b74159e19c Fix totalCPUsImpl for iOS derived platforms 2020-03-03 12:51:07 +01:00
Alexandru Militaru
bb62aaca3d Replaced version (unittest) with version (StdUnittest) to avoid unnecessary overhead when compiling with -unittest 2020-01-19 14:05:17 +02:00
Bernhard Seckinger
170107cc14 Fix Issue 10126 - Make TaskPool terminate on its own or improve docs 2019-11-14 17:34:42 +01:00
Bernhard Seckinger
97abb91952 Fix Issue 10902 - some phobos unittests take an excessive amount of time 2019-11-12 20:21:03 +01:00
Bastiaan Veelo
9419f57348
Make task() example compilable.
This example seems to not have worked ever.

You cannot create a delegate to an uninstantiated template function, and for the task() template function to be able to deduce a
function, all optional parameters to read() need to be given.

The delegate issue is kind of obvious. The default parameter issue I don't know whether is a compiler limitation that could be lifted or not.

These fixes make the example less pretty, especially compared to the example of the other overload of task(), but is it how it is.

Runnable variant: https://run.dlang.io/is/WAns8z (not for publication)
2019-09-25 11:43:13 +02:00
David Gileadi
775bcdee51 Turn on -preview=markdown 2019-07-04 10:28:30 -07:00
RazvanN7
2669a2b565 Fix 2 more cases 2019-06-27 16:40:04 +03:00
Hiroki Noda
d17f2eb9f2 Fix Issue 19513 - Use sched_getaffinity(2) to get the number of CPU
cores if available

Currently std.parallelism.totalCPUs is implemented by
sysconf(_SC_NPROCESSORS_ONLN) on Posix platoform. However, on GNU/Linux,
usable number of processors may be restricted if a process runs in
container. In case it's better to use sched_getaffinity(2).

ref: http://man7.org/linux/man-pages/man1/nproc.1.html
2019-05-24 14:30:05 +09:00
Walter Bright
ae16dadfaa add isLvalue() to prepare for rvalue ref 2019-05-18 17:29:00 -07:00
tibi77
7ae2e67a47 Remove redundant body of @disable functions. Issue 14854 DMD (#6893)
Remove redundant body of @disable functions. Issue 14854 DMD
merged-on-behalf-of: Nicholas Wilson <thewilsonator@users.noreply.github.com>
2019-03-06 02:00:04 +01:00
Nathan Sashihara
6ffd4e7f28 Replace imports of core.sys.windows.windows to speed up compilation 2018-12-17 21:03:31 -05:00
Iain Buclaw
fd5facfe04 posix.mak: Enforce whitespace before opening parenthesis for version conditions 2018-09-22 16:57:24 +02:00
Basile Burg
db819575f1 Fix issue 11959 - Set private symbols declared in version(unittest) blocks 2018-08-26 10:22:11 +02:00
Sebastian Wilzbach
3f44a4cd73 Fix issue 17019 - std.algorithm.iteration.each should be usable with parallel 2018-08-01 16:25:26 +02:00
Sebastian Wilzbach
c324714fde Remove a few cases of underscore escaping 2018-06-04 13:05:01 +02:00
The Dlang Bot
e13e3889ac
Merge pull request #6435 from JackStouffer/input-range-link
Make references to input ranges a link to isInputRange
merged-on-behalf-of: Sebastian Wilzbach <sebi.wilzbach@gmail.com>
2018-04-15 01:42:45 +02:00
Steven Schveighoffer
d4a35f09da More removal of version(unittest) 2018-04-13 12:20:02 -04:00
Jack Stouffer
e14f89e170 Make references to input ranges a link to isInputRange 2018-04-08 16:19:57 -04:00
Sebastian Wilzbach
6f766dce5d Remove redundant 'static' storage classes 2018-04-05 13:11:48 +02:00
Sebastian Wilzbach
42894784dd Markdownify Phobos
$(D word) -> `word`
2018-04-02 22:32:47 +02:00
Jack Stouffer
663b5b9278 Revert addition of StdUnittest 2018-02-20 13:32:32 -05:00
Jack Stouffer
18cbb29b04 Replaced version(unittest) blocks with version(StdUnittest) 2018-02-01 19:56:59 -05:00
The Dlang Bot
fa0a6192a1
Merge pull request #5951 from acehreli/TaskPool_fold
Fix Issue 18096 - Add fold() to std.parallelism
merged-on-behalf-of: Sebastian Wilzbach <sebi.wilzbach@gmail.com>
2018-01-17 06:05:48 +01:00
Andrei Alexandrescu
c1c8e8681e
remove surprising emtpy line 2018-01-16 11:58:56 -05:00
Walter Bright
b8291f2d5d std.parallelism: replace explicit code with Throwable.chainTogether() 2018-01-09 00:57:16 +01:00
Ali Çehreli
f9e3dde2bb Use string lambdas in non-documentation unittests to reduce memory usage of dmd 2017-12-28 22:56:23 -08:00
Ali Çehreli
8cfff5e810 Use message with static assert(0), use aliases instead of nested functions, do not use format in CTFE, add more unit tests. 2017-12-26 23:47:12 -08:00
Ali Çehreli
665e4adbce Implement std.parallelism.fold with static if branches instead of with template specializations 2017-12-26 22:40:48 -08:00
Ali Çehreli
673c4e959d Apply review comments: Backticks for inline code, StdUnittest, etc. 2017-12-26 22:40:48 -08:00
Ali Çehreli
c472b2303d Fix Issue 18096 - Add fold() to std.parallelism 2017-12-26 22:40:48 -08:00
Diederik de Groot
31ca73d58d
Port of phobos to DragonFlyBSD
Notes:
- FIXME message related to dragonfly malloc issue (issue reported on upstream dragonfly issue database)
2017-12-20 08:05:49 +01:00