On 02.07.2014 08:17, Ali Çehreli wrote:
There is an example in GC.addRoot() documentation where the programmer
is trying to mark a memory block as NO_MOVE:
http://dlang.org/phobos/core_memory.html#.GC.addRoot
auto context = new Object;
GC.addRoot(cast(void*)context);
GC.setA
There is an example in GC.addRoot() documentation where the programmer
is trying to mark a memory block as NO_MOVE:
http://dlang.org/phobos/core_memory.html#.GC.addRoot
auto context = new Object;
GC.addRoot(cast(void*)context);
GC.setAttr(cast(void*)context, GC.BlkAttr.NO_MOVE);
On Tuesday, 1 July 2014 at 13:53:12 UTC, Ali Çehreli wrote:
On 07/01/2014 03:21 AM, Puming wrote:
> I can safely assume ref is better than pointer here
I agree.
> because it plays nicely with UFCS.
I don't understand that part. :) The following is the same
program with just two differences:
Vlad Levenfeld:
Will there be a @nogc or @noheap flag in 2.066?
A @nogc. (The idea of @noheap was refused and I've closed down
the Enhancement request).
Bye,
bearophile
How did you allocate your array? The GC has the APPENDABLE
attribute special for memory blocks that are going to be used
as slices:
I allocated with new T[n]. I've tried allocating with both the
APPENDABLE and NO_SCAN blocks but beyond a certain allocation
size this doesn't work, I get a repo
On 07/01/2014 03:51 PM, Vlad Levenfeld wrote:
> Thanks for your replies. The article was quite helpful in clarifying
> some questions I had.
>
> I decided to benchmark the different append methods (with
> ["releaseMode", "inline", "noBoundsCheck", "optimize"]) by appending
> 10,000 elements to ar
Thanks for your replies. The article was quite helpful in
clarifying some questions I had.
I decided to benchmark the different append methods (with
["releaseMode", "inline", "noBoundsCheck", "optimize"]) by
appending 10,000 elements to arrays with
~=,
Appender,
with and without first r
On Tue, 01 Jul 2014 21:00:58 +, Justin Whear wrote:
> On Tue, 01 Jul 2014 20:42:14 +, seany wrote:
>
>> On Tuesday, 1 July 2014 at 15:32:31 UTC, Justin Whear wrote:
>>
>>
>>> A pipe can be unidirectional only, but you can use more than one.
>>
>> and what about FIFO or LIFO s?
>
> You
On Tue, 01 Jul 2014 20:42:14 +, seany wrote:
> On Tuesday, 1 July 2014 at 15:32:31 UTC, Justin Whear wrote:
>
>
>> A pipe can be unidirectional only, but you can use more than one.
>
> and what about FIFO or LIFO s?
You can use the C mkfifo function (import core.sys.posix.sys.stat) to
cre
On Tuesday, 1 July 2014 at 15:32:31 UTC, Justin Whear wrote:
A pipe can be unidirectional only, but you can use more than
one.
and what about FIFO or LIFO s?
On Tuesday, 1 July 2014 at 13:03:54 UTC, Vlad Levenfeld wrote:
I was mistaken earlier, decrementing the length counter also
sets the capacity to 0.
Besides just learning to use assumeSafeAppend (as mentioned
already), I'd also recommend reading the article on D slices to
deeper understand the
On Tue, 01 Jul 2014 13:00:47 +, seany wrote:
> 1. Bidirectional Pipes - I would like to write something to a second
> program (UNIX, resp GNU/LINUX environment) and listen to what it has to
> say.
BTW, for convenience, you probably want to use pipeProcess or pipeShell.
On Tuesday, 1 July 2014 at 18:13:42 UTC, bearophile wrote:
Gecko:
is there a scanl like in haskell (like reduce but returning
the intermediate results as well).
Request in bugzilla, ma no Phobos pull request implementation
yet.
Bye,
bearophile
Here's the issue https://issues.dlang.org/sh
Gecko:
is there a scanl like in haskell (like reduce but returning the
intermediate results as well).
Request in bugzilla, ma no Phobos pull request implementation yet.
Bye,
bearophile
On Tuesday, 1 July 2014 at 17:51:17 UTC, Justin Whear wrote:
There is a zip function in std.range. It produces a range of
tuples that
you can then map over.
Thank you,
I couldnt figure out what std.range.zip makes from the
documentation.
something else : is there a scanl like in haskell (
On Tue, 01 Jul 2014 17:49:53 +, Gecko wrote:
> Hello,
> is there a fancy way do a zipWith (map with multiple ranges). There is
> no in std.algorithm, or does it have a different name?
There is a zip function in std.range. It produces a range of tuples that
you can then map over.
Hello,
is there a fancy way do a zipWith (map with multiple ranges).
There is no in std.algorithm, or does it have a different name?
In short:
Why is this, and what do I do about it?
http://dlang.org/phobos/object.html#.assumeSafeAppend
On Tuesday, 1 July 2014 at 12:33:15 UTC, Vlad Levenfeld wrote:
I'm trying to implement some wrappers atop preallocated arrays,
so I'm calling reserve in the constructor, have an invariant t
On Tue, 01 Jul 2014 13:00:47 +, seany wrote:
> I read the manual here:
> http://dlang.org/phobos/std_process.html#.spawnProcess
>
> However, I need to (I can not remember, nor can I find in the forums any
> info thereon) create
>
> 1. Bidirectional Pipes - I would like to write something to
On Monday, 30 June 2014 at 20:53:25 UTC, Sergey Protko wrote:
Is there any proper way to do on-demand lazy-initialization of
used library, which will be also thread-safe? How do i need to
handle cases where some methods, which requires library to be
initialized, called from different threads
On 07/01/2014 03:21 AM, Puming wrote:
> I can safely assume ref is better than pointer here
I agree.
> because it plays nicely with UFCS.
I don't understand that part. :) The following is the same program with
just two differences: prompt() takes a pointer and 'server' is a pointer.
import
I read the manual here:
http://dlang.org/phobos/std_process.html#.spawnProcess
However, I need to (I can not remember, nor can I find in the
forums any info thereon) create
1. Bidirectional Pipes - I would like to write something to a
second program (UNIX, resp GNU/LINUX environment) and lis
I was mistaken earlier, decrementing the length counter also sets
the capacity to 0.
I'm trying to implement some wrappers atop preallocated arrays,
so I'm calling reserve in the constructor, have an invariant to
ensure that the array.ptr never moves, and use in-contracts to
make sure any insertion and appends don't put me over the array
capacity.
I find that I'm able to safe
On Tuesday, 1 July 2014 at 05:58:19 UTC, Uranuz wrote:
Thanks for quick response. I really forget to look into
language __traits statement.
Another option:
enum isFoo(T) = is(T == Foo!P, P...);
By using such an is-expression you get the parameters Foo was
instantiated with as an added bonus.
On Tuesday, 1 July 2014 at 07:53:27 UTC, bearophile wrote:
Puming:
is this a good practice to use `ref in` with structs instead
of traditional pointer syntax (which does not play well with
UFCS though) ? Is there any perfomance implications with `ref
in`? I tried that it does not seem to copy
Puming:
is this a good practice to use `ref in` with structs instead of
traditional pointer syntax (which does not play well with UFCS
though) ? Is there any perfomance implications with `ref in`? I
tried that it does not seem to copy the parameter value,
A "ref" is equivalent to a pointer t
27 matches
Mail list logo