On Saturday, 14 January 2017 at 15:30:42 UTC, Rainer Schuetze
wrote:
In addition, you need to lookup the pool anyway to figure out
if the pointer points to non-managed memory (stack, global
data, malloc'd memory).
Makes me wonder about a GC'd language where each pointer is
actually a member
Let's say I want to create an array of random numbers and do some
operations on them:
void main() {
import std.random;
//Generate array of random numbers
int arrSize = 1;
double[] arr = new double[](arrSize);
foreach (i; 0..arrSize)
arr[i] = uniform01();
On Friday, 20 January 2017 at 23:15:51 UTC, solidstate1991 wrote:
Github: https://github.com/ZILtoid1991/pixelperfectengine
Any documentation?
On Saturday, 21 January 2017 at 12:33:57 UTC, albert-j wrote:
Now I dmd -profile it and look at the performance of funcA with
d-profile-viewer. Inside funcA, only 20% of time is spend in
funcB, but the rest 80% is self-time of funcA. How is it
possible, when funcB has three times the
Le 21/01/2017 à 13:24, Jerry a écrit :
On Friday, 20 January 2017 at 22:47:17 UTC, Xavier Bigand wrote:
Hi,
I am writing some code with opengl commands that I want to check in
debug, so I am using the function checkgl (from glamour lib).
The issue is that checkgl throw exception and can't be
On Thursday, 19 January 2017 at 08:06:04 UTC, ketmar wrote:
alias is not a macro, it is alias to *symbol*. only symbol, not
any arbitrary expression.
In fact, it can nowadays be. You just have to mark it so, with a
lambda:
void main()
{ import std.stdio;
auto myArray = [2, 3, 5, 6];
https://issues.dlang.org/show_bug.cgi?id=17055
--- Comment #2 from Ralph Alexander Bariz ---
//
mixin template Foo()
{
int x;
this()
{
this.x=5;
}
}
class Bar
{
mixin Foo;
this(int
https://issues.dlang.org/show_bug.cgi?id=17055
--- Comment #3 from Ralph Alexander Bariz ---
//
mixin template Foo()
{
int x;
this()
{
this.x=5;
}
}
class Bar
{
mixin Foo;
}
void main()
On Sat, 21 Jan 2017 04:01:06 +, bitwise wrote:
> On Saturday, 21 January 2017 at 02:47:49 UTC, bitwise wrote:
>> [...]
>
> I can see that 'TypedAllocator' exists, but with a different interface
> than the rest of the allocators. Why wouldn't all allocators just have a
> common interface?
On Saturday, 21 January 2017 at 02:47:49 UTC, bitwise wrote:
When std.experimental.allocator was created, I was under the
impression it was meant to be used to make containers. But
since allocate() returns void[], casts are required before
using that memory, which is unsafe.
Is my only
On Saturday, 21 January 2017 at 01:55:54 UTC, Chris Wright wrote:
This would have been the perfect place for you to describe what
this project is about.
Pixel Perfect Engine is a 2d graphics system based on SDL and
FreeImage. It appears to be tile-based and incorporate a map
editor.
It's
On Saturday, 21 January 2017 at 09:56:29 UTC, ZombineDev wrote:
On Saturday, 21 January 2017 at 02:47:49 UTC, bitwise wrote:
When std.experimental.allocator was created, I was under the
impression it was meant to be used to make containers. But
since allocate() returns void[], casts are
Le 21/01/2017 à 10:54, John Colvin a écrit :
On Saturday, 21 January 2017 at 00:03:11 UTC, Xavier Bigand wrote:
std::numeric_limits::lowest() is describe as "A finite value x such
that there is no other finite value y
* where y < x."
According to what I presume that definition means
On 2017-01-21 03:59, Jack Stouffer wrote:
But 2.073 isn't released yet.
It's in release candidate. The current output is pretty embarrassing.
--
/Jacob Carlborg
On Friday, 20 January 2017 at 22:47:17 UTC, Xavier Bigand wrote:
Hi,
I am writing some code with opengl commands that I want to
check in debug, so I am using the function checkgl (from
glamour lib).
The issue is that checkgl throw exception and can't be @nogc, I
had try to use
I'm not sure if it's what happening in this case but, in code
as simple as this, function calls can sometimes be the
bottleneck. You should see how compiling with/without -O
affects performance, and adding `pragma(inline)` to funcB.
When compiled with -inline, the profiler does not report the
On Friday, 20 January 2017 at 14:22:23 UTC, Adam D. Ruppe wrote:
On Friday, 20 January 2017 at 07:50:23 UTC, Jacob Carlborg
wrote:
That doesn't work well with a unit test framework that want to
catch assertions to be able to continue with other tests.
I'd suggest writing a new assert handler
On Saturday, 21 January 2017 at 00:03:11 UTC, Xavier Bigand wrote:
std::numeric_limits::lowest() is describe as "A finite value
x such that there is no other finite value y
* where y < x."
According to what I presume that definition means ("no other
finite value" means "no other
On Saturday, 21 January 2017 at 14:27:35 UTC, Dmitry wrote:
On Friday, 20 January 2017 at 23:15:51 UTC, solidstate1991
wrote:
Github: https://github.com/ZILtoid1991/pixelperfectengine
Any documentation?
Documentation is in the works with a few sample codes, but
currently I have a lot of
On 2017-01-21 00:52, 岩倉 澪 wrote:
This has already been fixed? Is this fix in a stable release yet? I
might not be on the latest version...
It's fixed in DMD, _not_ in RDMD.
--
/Jacob Carlborg
On 01/20/2017 04:26 AM, Ethan Watson wrote:
Landed in my inbox while I was on holiday in Australia (why did I leave
it three and a half years between visits jeez never do that again you
fool).
http://imgur.com/a/I6GrF
In summary:
* 4.5 out of 5 audience rating. Average was 4.22.
* Head count
https://issues.dlang.org/show_bug.cgi?id=17102
--- Comment #9 from github-bugzi...@puremagic.com ---
Commits pushed to master at https://github.com/dlang/phobos
https://github.com/dlang/phobos/commit/e80d3b5745e7875980f6c69a2c09cccb647fa9a6
Fix Issue 17102: std.write.file generates a
On Saturday, 21 January 2017 at 16:32:36 UTC, Andrei Alexandrescu
wrote:
Congratulations, that looks like a very good performance! Could
you please explain a bit how the Google Slides feature you
mentioned works? -- Andrei
The core functionality is that a web link is provided that allows
On Saturday, 21 January 2017 at 16:28:16 UTC, Andrei Alexandrescu
wrote:
alignedAllocate provides access to OS/clib-provided primitives
for aligned allocation. Those don't require a special
deallocation function, see e.g.
http://en.cppreference.com/w/c/memory/aligned_alloc. -- Andrei
This
Hi friends,
Is there a way to "compile" d code to C, similar to what nim does?
That would be cool for greater portability.
On 01/21/2017 12:14 PM, bitwise wrote:
On Saturday, 21 January 2017 at 16:28:16 UTC, Andrei Alexandrescu wrote:
alignedAllocate provides access to OS/clib-provided primitives for
aligned allocation. Those don't require a special deallocation
function, see e.g.
On Saturday, 14 January 2017 at 04:37:01 UTC, Chris Wright wrote:
Unfortunately, given an interior pointer, you can't identify
the base of its heap object in constant time.
1. Split the heap in chunk of size n being a power of 2, say 4M.
Align them 4M.
2. Find the chunk an alloc is part of in
On 01/20/2017 09:15 AM, Russel Winder via Digitalmars-d wrote:
On Fri, 2017-01-20 at 07:10 +, Andrei Alexandrescu via Digitalmars-
d wrote:
[…]
It would be worth it. I think a fix takes some thinking because if I
remember correctly the compiler does not accept files without an
extension as
On Saturday, 21 January 2017 at 17:41:58 UTC, NVolcz wrote:
Any screenshots?
https://github.com/ZILtoid1991/pixelperfectengine/issues/1
There's even a video showcasing the scrolling capabilities of the
engine. I made more during development, most of them are about
the bugs.
Thank you both!
On Saturday, 21 January 2017 at 18:38:22 UTC, Nestor wrote:
Hi friends,
Is there a way to "compile" d code to C, similar to what nim
does?
That would be cool for greater portability.
The wiki says there was a dmd fork that attempted this 5 years
ago, don't know how far he got:
On Saturday, 21 January 2017 at 10:15:46 UTC, ZombineDev wrote:
On Saturday, 21 January 2017 at 09:56:29 UTC, ZombineDev wrote:
On Saturday, 21 January 2017 at 02:47:49 UTC, bitwise wrote:
When std.experimental.allocator was created, I was under the
impression it was meant to be used to make
On 01/21/2017 01:06 AM, Eugene Wissner wrote:
On Saturday, 21 January 2017 at 05:52:49 UTC, bitwise wrote:
I hadn't noticed this, but I immediately see two problems:
1) there is no alignedDeallocate() which is needed because aligned
allocators usually prepend metadata containing a pointer to
On Friday, 20 January 2017 at 23:15:51 UTC, solidstate1991 wrote:
Github: https://github.com/ZILtoid1991/pixelperfectengine
Any screenshots?
On Saturday, 21 January 2017 at 18:38:22 UTC, Nestor wrote:
That would be cool for greater portability.
The hard part in porting to a new platform is rarely the code
generation - gdc and ldc have diverse backends already (indeed,
they tend to work for D as well as C there). But you still
On Saturday, 21 January 2017 at 18:38:22 UTC, Nestor wrote:
Hi friends,
Is there a way to "compile" d code to C, similar to what nim
does?
That would be cool for greater portability.
No, and this is actually a terrible idea. See
On Sunday, 15 January 2017 at 05:17:10 UTC, Adam D. Ruppe wrote:
On Sunday, 15 January 2017 at 04:11:06 UTC, Craig Dillabaugh
wrote:
I've been trying to find something on this, but haven't yet,
but I am not sure if website work would be considered
appropriate.
The website is still a program,
On Saturday, 21 January 2017 at 23:24:52 UTC, Andrei Alexandrescu
wrote:
On 1/21/17 5:44 PM, bitwise wrote:
About alignedMalloc:
In C++ for example, I may want to use a vector full some SIMD
type:
class alignas(16) Vec4 {
union {
struct { float x, y, z, w; };
__m128 m;
On Saturday, 21 January 2017 at 17:26:35 UTC, Andrei Alexandrescu
wrote:
On 01/21/2017 12:14 PM, bitwise wrote:
On Saturday, 21 January 2017 at 16:28:16 UTC, Andrei
Alexandrescu wrote:
alignedAllocate provides access to OS/clib-provided
primitives for
aligned allocation. Those don't require a
Simplified:
import std.stdio;
struct Widget {
private int[] array;
this(uint length) {
array = new int[length];
writefln("ctor called : %s", array.ptr);
}
this(this) {
writef( "this(this) called: %s", array.ptr );
array = array.dup;
On 1/21/17 5:44 PM, bitwise wrote:
About alignedMalloc:
In C++ for example, I may want to use a vector full some SIMD type:
class alignas(16) Vec4 {
union {
struct { float x, y, z, w; };
__m128 m;
};
};
std::vector points = { ... };
In C++ however, 'new' does not
https://issues.dlang.org/show_bug.cgi?id=17066
--- Comment #3 from github-bugzi...@puremagic.com ---
Commits pushed to master at https://github.com/dlang/phobos
https://github.com/dlang/phobos/commit/4d19d0ad3aab77a9a4a9b2dedaccbacfdeb4e45e
Fix issue 17066
On Sat, 21 Jan 2017 22:44:49 +, bitwise wrote:
> So I use a custom aligned allocator:
>
> template
> class AlignedAllocator {
> T* allocate(size_type n) {
> return (T*)_aligned_malloc(ALIGN, n * sizeof(T));
> }
> };
>
> SIMD operations(aligned load and store) can now
On 01/21/2017 03:19 PM, Ali Çehreli wrote:
this(this) {
TIL! Change the signature and it works without copies:
this(const(this)) {
// ...
}
How did I miss this for so long?
Ali
On Sunday, 22 January 2017 at 00:13:10 UTC, Chris Wright wrote:
On Sat, 21 Jan 2017 22:44:49 +, bitwise wrote:
So I use a custom aligned allocator:
template
class AlignedAllocator {
T* allocate(size_type n) {
return (T*)_aligned_malloc(ALIGN, n * sizeof(T));
}
};
SIMD
On Sun, 22 Jan 2017 00:53:45 +, bitwise wrote:
> I understand this, but I've given a solid example which supports the
> former, and haven't seen a counter example which supports the latter.
Because examples that are easy to generate are small and small examples
don't have coarse-grained
On 01/21/2017 03:36 PM, Ali Çehreli wrote:
> Change the signature and it works without copies:
>
> this(const(this)) {
> // ...
> }
Ugh... :( It's not a post-blit. Then what is it?
Ali
On Sunday, 22 January 2017 at 01:02:09 UTC, Chris Wright wrote:
On Sun, 22 Jan 2017 00:53:45 +, bitwise wrote:
I understand this, but I've given a solid example which
supports the former, and haven't seen a counter example which
supports the latter.
Because examples that are easy to
I'm not sure whether this should be counted as a bug, but I ran
into it and thought it deserved mentioning. I've been testing
this with DMD on Windows.
I wrote this function to support parsing of strings as floating
point values:
On Sunday, 22 January 2017 at 01:54:59 UTC, pineapple wrote:
When you write `real x = 0.0005;` x in fact represets a value
of about
0.00050032187251995663412884596255025826394.
This is a about 3.2 * 10^-23 more than 0.0005.
The output of my function in this case was about
On Saturday, 21 January 2017 at 23:24:52 UTC, Andrei Alexandrescu
wrote:
Andrei
Anyways, design opinions aside, I would be satisfied if an
aligned allocator were included in std.allocators that provided
aligned heap memory using allocate()/deallocate(). The rest is
just details with no
On 01/21/2017 07:22 PM, Basile B. wrote:
On Sunday, 22 January 2017 at 00:31:38 UTC, Ali Çehreli wrote:
On 01/21/2017 03:36 PM, Ali Çehreli wrote:
> Change the signature and it works without copies:
>
> this(const(this)) {
> // ...
> }
Ugh... :( It's not a post-blit. Then what
On Sunday, 22 January 2017 at 06:28:35 UTC, Chris Wright wrote:
On Sun, 22 Jan 2017 05:02:43 +, Araq wrote:
It's an O(1) that requires a hash table lookup in general
because allocations can exceed the chunk size and so you
cannot just mask the pointer and look at the chunk header
because
On Sunday, 22 January 2017 at 03:42:21 UTC, Ali Çehreli wrote:
On 01/21/2017 07:22 PM, Basile B. wrote:
[...]
Wow! Thanks.
I know about 'alias this' but this (pun!) is new to me. TIL
indeed and WAT (four exclamation marks is right in this
case. :o) )
import std.stdio;
struct S {
https://issues.dlang.org/show_bug.cgi?id=17112
Issue ID: 17112
Summary: Simple writeln call produces cryptic error message
Product: D
Version: D2
Hardware: x86_64
OS: Mac OS X
Status: NEW
Severity: normal
On Saturday, 21 January 2017 at 05:59:32 UTC, Stefan Koch wrote:
On Friday, 20 January 2017 at 19:08:28 UTC, Stefan Koch wrote:
Druntime and phobos broke, the reason being that,
I did test against an outdated version of druntime/phobos.
I am working on getting them to compile again.
Adding
On Sunday, 22 January 2017 at 00:31:38 UTC, Ali Çehreli wrote:
On 01/21/2017 03:36 PM, Ali Çehreli wrote:
> Change the signature and it works without copies:
>
> this(const(this)) {
> // ...
> }
Ugh... :( It's not a post-blit. Then what is it?
Ali
This is a __ctor that takes
https://issues.dlang.org/show_bug.cgi?id=17112
--- Comment #1 from Gillett ---
issue 16661 - https://issues.dlang.org/show_bug.cgi?id=16661 - seemed to have
the same error but in a different form. it was the only issue i found that had
a similar error message after searching
On Sun, 22 Jan 2017 05:02:43 +, Araq wrote:
> It's an O(1) that requires a hash table lookup in general because
> allocations can exceed the chunk size and so you cannot just mask the
> pointer and look at the chunk header because it might not be a chunk
> header at all. Know any production
On Saturday, 21 January 2017 at 17:42:46 UTC, deadalnix wrote:
1. Split the heap in chunk of size n being a power of 2, say
4M. Align them 4M.
2. Find the chunk an alloc is part of in O(1) bu masking the
lower bits (22 bits to mask in our 4M case).
3. Have a table of page descriptor in the
Compile this and see, (it's crazy!):
import std.stdio;
struct Widget {
private int[] array;
this(uint length) {
array = new int[length];
}
this(this) {
writeln( "this(this) called" );
array = array.dup;
}
Just import iup like this:
import iup; // for IUP
import im; // for Imaging Toolkit
import cd; // for 2D Graphics Library
-- --
??: "Jordan Wilson via
Digitalmars-d-announce";;
:
Hi everybody!
Last year turned out to be difficult for D development for me. I
try to come back this year. Here's my start:
I am a speaker in the LLVM toolchain devroom @ FOSDEM'17. My talk
is about profile guided optimization in LDC and of course I will
promote D.
My talk is based on
63 matches
Mail list logo