Re: Allocation failures

2016-02-17 Thread Marc Schütz via Digitalmars-d
On Wednesday, 17 February 2016 at 01:09:20 UTC, Adam D. Ruppe wrote: On Wednesday, 17 February 2016 at 00:45:35 UTC, Chris Wright wrote: http://dpldocs.info/search/search?searchTerm=emplace to create an exception object in manually allocated memory. Aye, this overload:

Re: Allocation failures

2016-02-17 Thread Chris Wright via Digitalmars-d
On Wed, 17 Feb 2016 02:24:51 +, cym13 wrote: > On Wednesday, 17 February 2016 at 02:23:34 UTC, cym13 wrote: >> Such errors are static errors, they aren't allocated on the stack, a >> 128 bytes buffer is shared accross threads to keep them. > > Sorry, of course I meant they *are* allocated on

Re: Allocation failures

2016-02-17 Thread Chris Wright via Digitalmars-d
On Wed, 17 Feb 2016 01:09:20 +, Adam D. Ruppe wrote: > On Wednesday, 17 February 2016 at 00:45:35 UTC, Chris Wright wrote: >> http://dpldocs.info/search/search?searchTerm=emplace to create an >> exception object in manually allocated memory. > > Aye, this overload: >

Re: Allocation failures

2016-02-17 Thread Mike Parker via Digitalmars-d
On Wednesday, 17 February 2016 at 14:01:17 UTC, Jardík wrote: consider this solved (where can I mark it as such?). The forum is a web fronted for a news server. No such feature.

Re: Allocation failures

2016-02-17 Thread Jardík via Digitalmars-d
On Wednesday, 17 February 2016 at 06:52:21 UTC, thedeemon wrote: So keep GC heap for small litter (including exceptions) and use other allocators for large pieces of data. This way you may get best of what D offers without long-GC-pause or out-of-memory-termination pains. I will probably do

Re: Allocation failures

2016-02-16 Thread thedeemon via Digitalmars-d
On Tuesday, 16 February 2016 at 17:15:17 UTC, Jardík wrote: But if I couldn't use GC and do all allocations and deallocations manually, I wouldn't even be able to use exceptions and there would also no longer be much reason to write it in D. I'd say if you're going to grow GC heap so big it

Re: Allocation failures

2016-02-16 Thread cym13 via Digitalmars-d
On Wednesday, 17 February 2016 at 02:23:34 UTC, cym13 wrote: Such errors are static errors, they aren't allocated on the stack, a 128 bytes buffer is shared accross threads to keep them. Sorry, of course I meant they *are* allocated on the stack.

Re: Allocation failures

2016-02-16 Thread cym13 via Digitalmars-d
On Tuesday, 16 February 2016 at 17:15:17 UTC, Jardík wrote: But if I couldn't use GC and do all allocations and deallocations manually, I wouldn't even be able to use exceptions and there would also no longer be much reason to write it in D. I did some searching and came into discussion and

Re: Allocation failures

2016-02-16 Thread Adam D. Ruppe via Digitalmars-d
On Wednesday, 17 February 2016 at 00:45:35 UTC, Chris Wright wrote: http://dpldocs.info/search/search?searchTerm=emplace to create an exception object in manually allocated memory. Aye, this overload: http://dpldocs.info/experimental-docs/std.conv.emplace.3.html though the example there is

Re: Allocation failures

2016-02-16 Thread Chris Wright via Digitalmars-d
On Tue, 16 Feb 2016 17:35:02 +, Adam D. Ruppe wrote: > On Tuesday, 16 February 2016 at 17:15:17 UTC, Jardík wrote: >> But if I couldn't use GC and do all allocations and deallocations >> manually, I wouldn't even be able to use exceptions and there would >> also no longer be much reason to

Re: Allocation failures

2016-02-16 Thread Adam D. Ruppe via Digitalmars-d
On Tuesday, 16 February 2016 at 17:15:17 UTC, Jardík wrote: But if I couldn't use GC and do all allocations and deallocations manually, I wouldn't even be able to use exceptions and there would also no longer be much reason to write it in D. You can use exceptions without the GC and D offers

Re: Allocation failures

2016-02-16 Thread Jardík via Digitalmars-d
But if I couldn't use GC and do all allocations and deallocations manually, I wouldn't even be able to use exceptions and there would also no longer be much reason to write it in D. I did some searching and came into discussion and there found out that in case of an error thrown, D just

Allocation failures

2016-02-14 Thread Jardík via Digitalmars-d
When I was interested in D some time ago, I believe GC was aborting the application on allocation failures. Is that still the case today? I am looking into using D for my new application, but I need some guarantees that I can at least save some critical data, when such thing happens, perhaps

Re: Allocation failures

2016-02-14 Thread cym13 via Digitalmars-d
On Sunday, 14 February 2016 at 12:10:34 UTC, Jardík wrote: When I was interested in D some time ago, I believe GC was aborting the application on allocation failures. Is that still the case today? I am looking into using D for my new application, but I need some guarantees that I can at least

Re: Allocation failures

2016-02-14 Thread Rikki Cattermole via Digitalmars-d
Since you want such fine grained control, you probably don't want to use the GC to allocate with. Take a look at [0]. That should give you the fine grained control you desire. Most importantly make, makeArray, expandArray, shrinkArray and dispose. You would need to be a bit careful with some