I asked this over on stackoverflow.com to see what people using other
languages have to say, as well as the D community. The reason I ask is
to see if memory allocation can be allowed in functions marked nothrow.
http://stackoverflow.com/questions/333736/is-out-of-memory-a-recoverable-error
On Tue, Dec 2, 2008 at 7:26 PM, bearophile [EMAIL PROTECTED] wrote:
Bill Baxter:
What about Perl shows that auto-flattening is bad?
You can find a note here:
http://steve.yegge.googlepages.com/ancient-languages-perl
Larry decided to flatten lists by default. Hence, if you write this:
@x =
Bill Baxter:
What about Perl shows that auto-flattening is bad?
You can find a note here:
http://steve.yegge.googlepages.com/ancient-languages-perl
Larry decided to flatten lists by default. Hence, if you write this:
@x = (1, 2, 3, (4, 5));
It automagically turns into (1, 2, 3, 4, 5).
With
In a program Out of Memory is recoverable, for example your program can use
several caches, buffers, and it can use data already present on disk too, or
data that can be moved on disk now.
A good program when finds an out of memory situation can clear its caches,
delete not essential data
John Reimer wrote:
In D (windows) it would look like so (assuming you have done away with
the compilers internal detection of COM interfaces):
extern(C++) interface IUnknown:
{
extern(Windows):
int QueryInterface(nsIID* uuid, void **result);
int AddRef();
int
Walter Bright wrote
I asked this over on stackoverflow.com to see what people using other
languages have to say, as well as the D community. The reason I ask is to
see if memory allocation can be allowed in functions marked nothrow.
Steven Schveighoffer wrote:
It can be. For example, if you want to allocate a gigantic buffer to see if
you can load a file, you may catch for failure, and display an appropriate
message to the user on failure. The application could still continue to
run. I think the difference between
Walter Bright wrote:
I asked this over on stackoverflow.com to see what people using other
languages have to say, as well as the D community. The reason I ask is
to see if memory allocation can be allowed in functions marked nothrow.
On Tue, Dec 2, 2008 at 11:57 AM, Russell Lewis
[EMAIL PROTECTED] wrote:
It seems that D has (or rather, can have) a trivial solution to this
problem. Allow programs to register with the GC when they have memory which
can be easily freed (caches and such). Then you can make out of memory a
== Quote from Russell Lewis ([EMAIL PROTECTED])'s article
Walter Bright wrote:
I asked this over on stackoverflow.com to see what people using other
languages have to say, as well as the D community. The reason I ask is
to see if memory allocation can be allowed in functions marked nothrow.
Jarrett Billingsley wrote:
On Tue, Dec 2, 2008 at 11:57 AM, Russell Lewis
[EMAIL PROTECTED] wrote:
It seems that D has (or rather, can have) a trivial solution to this
problem. Allow programs to register with the GC when they have memory which
can be easily freed (caches and such). Then you
Since resource contention for memory allocations seems to be a big issue in D,
at least for me, and memory allocation is usually pretty fast, would it make
sense to make the lock used for GC.malloc a spinlock? Since memory allocation
takes very little time relative to a full timeslice, there is
Hi
I have a problem:
What's wrong about this code?
Code:
import std.stdio;
int main() {
writefln(%f, add(100, 786, 56.0));
return 0;
}
double add(double delegate()[] dgs...) {
double result = 0;
foreach(double delegate() dg; dgs) {
result += dg;
Jarrett Billingsley schrieb:
On Tue, Dec 2, 2008 at 1:30 PM, Fabian Claßen [EMAIL PROTECTED] wrote:
result += dg;
Just change that line to result += dg();. A delegate is like a
function; you call it to get the value.
Oh thank you.
I see. That's a stupid mistake of mine :D
On Tue, 02 Dec 2008 19:30:47 +0100, Fabian Claßen wrote:
Hi
I have a problem:
What's wrong about this code?
Code:
import std.stdio;
int main() {
writefln(%f, add(100, 786, 56.0));
return 0;
}
double add(double delegate()[] dgs...) {
double result = 0;
On Tue, 02 Dec 2008 22:45:03 +0300, Derek Parnell [EMAIL PROTECTED] wrote:
On Tue, 02 Dec 2008 19:30:47 +0100, Fabian Claßen wrote:
Hi
I have a problem:
What's wrong about this code?
Code:
import std.stdio;
int main() {
writefln(%f, add(100, 786, 56.0));
return 0;
}
double
On Tue, Dec 2, 2008 at 2:45 PM, Derek Parnell [EMAIL PROTECTED] wrote:
On Tue, 02 Dec 2008 19:30:47 +0100, Fabian Claßen wrote:
Hi
I have a problem:
What's wrong about this code?
Code:
import std.stdio;
int main() {
writefln(%f, add(100, 786, 56.0));
return 0;
}
double
Reply to Tomas,
The problem is that B has two vtables that implement the interface I.
However, in A.addChild, i.parent get's the first one (introduced by
A), and in main, it gets the second one (J , which derived from I).
The identity check then fails because the pointers aren't the same,
even
On Tue, 02 Dec 2008 22:53:25 +0300, Denis Koroskin wrote:
On Tue, 02 Dec 2008 22:45:03 +0300, Derek Parnell [EMAIL PROTECTED] wrote:
On Tue, 02 Dec 2008 19:30:47 +0100, Fabian Claßen wrote:
Hi
I have a problem:
What's wrong about this code?
Code:
import std.stdio;
int main() {
== Quote from Kagamin ([EMAIL PROTECTED])'s article
One can get rid of OOM just by adding a couple of lines to the default
malloc, that call custom handler
(similar to onOutOfMemoryError handler) wich does any magic wanted
Endless loop.
Sean
Sean Kelly Wrote:
== Quote from Kagamin ([EMAIL PROTECTED])'s article
One can get rid of OOM just by adding a couple of lines to the default
malloc, that call custom handler
(similar to onOutOfMemoryError handler) wich does any magic wanted
Endless loop.
magic is far more powerful than
Kagamin Wrote:
One can get rid of OOM just by adding a couple of lines to the default
malloc, that call custom handler (similar to onOutOfMemoryError handler) wich
does any magic wanted, so OOM doesn't break nothrow functions, and if it's
thrown, this means that recovery code has failed to
Reply to Frits,
BCS wrote:
Reply to Tomas,
The problem is that B has two vtables that implement the interface
I. However, in A.addChild, i.parent get's the first one (introduced
by A), and in main, it gets the second one (J , which derived from
I). The identity check then fails because the
BCS wrote:
Reply to Tomas,
The problem is that B has two vtables that implement the interface I.
However, in A.addChild, i.parent get's the first one (introduced by
A), and in main, it gets the second one (J , which derived from I).
The identity check then fails because the pointers aren't the
I tried writing to an associative array and got the exception:
[EMAIL PROTECTED](15): Array index out of bounds
the program below causes the exception:
module test;
import tango.io.Stdout;
import tango.io.Console;
struct S {uint i;}
int main()
{
S[char[]] s;
On Tue, Dec 2, 2008 at 7:34 PM, Zane [EMAIL PROTECTED] wrote:
I tried writing to an associative array and got the exception:
[EMAIL PROTECTED](15): Array index out of bounds
the program below causes the exception:
module test;
import tango.io.Stdout;
import tango.io.Console;
struct S
Hello Walter,
John Reimer wrote:
In D (windows) it would look like so (assuming you have done away
with the compilers internal detection of COM interfaces):
extern(C++) interface IUnknown:
{
extern(Windows):
int QueryInterface(nsIID* uuid, void **result);
int AddRef();
int Release();
}
I bet
Don wrote:
Strategy (1):
Windows used to have a WM_COMPACTING message (maybe it still does) which
was sent when the system was running low on memory. In D, you could
imagine a similar sort of system callback, which is called when memory
is short -- it means, free some memory now, otherwise
John Reimer wrote:
Okay, that is an important detail for me to know. But I assumed that a
C++ interface must not be allocated in D either. In must acquire a
pointer from an external factory that handles the allocation outside of
the gc range (C++ code must allocate/delete it's own objects).
Some Guy:
I am busy learning D and I want to be able to use classes now. I am
used to programming in C# where it does everything for you and you
don't have to think about this kind of thing so I now have no idea
how to compile a program from the command line that uses a class in
another
On Tue, 2 Dec 2008 09:28:53 + (UTC), Some Guy wrote:
I am busy learning D and I want to be able to use classes now. I am
used to programming in C# where it does everything for you and you
don't have to think about this kind of thing so I now have no idea
how to compile a program from the
I am busy learning D and I want to be able to use classes now. I am
used to programming in C# where it does everything for you and you
don't have to think about this kind of thing so I now have no idea
how to compile a program from the command line that uses a class in
another source file.
I have
http://d.puremagic.com/issues/show_bug.cgi?id=1961
--- Comment #15 from [EMAIL PROTECTED] 2008-12-02 09:07 ---
(In reply to comment #12)
This code duplication bug requires to write every rom method in three flavors
to provide good rom interface. For me, this entirely prevents use
http://d.puremagic.com/issues/show_bug.cgi?id=1961
[EMAIL PROTECTED] changed:
What|Removed |Added
CC||[EMAIL PROTECTED]
---
http://d.puremagic.com/issues/show_bug.cgi?id=1961
--- Comment #12 from [EMAIL PROTECTED] 2008-12-02 04:19 ---
Walter Bright wrote:
For me, the question is is solving these issues a large enough problem
that justifies adding a rather confusing new variation on const?
This
http://d.puremagic.com/issues/show_bug.cgi?id=1961
--- Comment #16 from [EMAIL PROTECTED] 2008-12-02 09:57 ---
You are right I hadn't fully re-read the your initial posting, it was a long
time ago ;)
--
http://d.puremagic.com/issues/show_bug.cgi?id=2485
Summary: non-static initialization of struct using static
initializer syntax generates wrong code
Product: D
Version: 1.035
Platform: PC
OS/Version: Linux
Status:
http://d.puremagic.com/issues/show_bug.cgi?id=1382
--- Comment #3 from [EMAIL PROTECTED] 2008-12-02 12:31 ---
We've had some success with reenabling boehm-gc:
http://www.dsource.org/projects/ldc/ticket/49 .
Another test with USE_BOEHM_GC=0, REDIRECT_MALLOC=GC_malloc and IGNORE_FREE
http://d.puremagic.com/issues/show_bug.cgi?id=2476
--- Comment #3 from [EMAIL PROTECTED] 2008-12-03 00:34 ---
I think you want runtime, not druntime. druntime is the old version that
Walter that got left in there.
--
http://d.puremagic.com/issues/show_bug.cgi?id=2488
--- Comment #3 from [EMAIL PROTECTED] 2008-12-03 01:33 ---
Alright, the following change to dmd.conf did it.
[EMAIL PROTECTED]/../src/phobos [EMAIL PROTECTED]/../src/druntime/import [EMAIL
PROTECTED]/../lib
I don't mind if that is
40 matches
Mail list logo