On 2/20/18 9:59 PM, Nicholas Wilson wrote:
FYI, File is a reference counted FILE* so theres not really any point of
heap allocating it.
More FYI, the reference counted payload is actually allocated on the C
heap :) So you are wasting a lot of effort to do something that is
already done.
On Wednesday, February 21, 2018 02:59:21 Nicholas Wilson via Digitalmars-d-
learn wrote:
> On Tuesday, 20 February 2018 at 15:32:45 UTC, Chris M. wrote:
> > Thanks for the info, that clears things up. Like I said, it was
> > more experimentation rather than me planning to actually use
> > it.
On Tuesday, 20 February 2018 at 15:32:45 UTC, Chris M. wrote:
Thanks for the info, that clears things up. Like I said, it was
more experimentation rather than me planning to actually use
it. Works now with the following modifications.
import std.stdio;
import core.stdc.stdlib;
import
On Tuesday, 20 February 2018 at 15:18:11 UTC, Adam D. Ruppe wrote:
On Tuesday, 20 February 2018 at 14:56:54 UTC, Chris M. wrote:
I'm doing this mainly for experimentation, but the following
piece of code gives all sorts of errors.
so important note: this will perform worse than the automatic
On Tuesday, 20 February 2018 at 14:56:54 UTC, Chris M. wrote:
I'm doing this mainly for experimentation, but the following
piece of code gives all sorts of errors. Hangs, segfaults or
prints nothing and exits
import std.stdio;
import core.stdc.stdlib;
void main()
{
auto f = cast(File *)
On Tuesday, 20 February 2018 at 15:21:59 UTC, Uknown wrote:
On Tuesday, 20 February 2018 at 14:56:54 UTC, Chris M. wrote:
void main()
[snip]
Never mind, I confused FILE* with File...
On Tuesday, 20 February 2018 at 14:56:54 UTC, Chris M. wrote:
I'm doing this mainly for experimentation, but the following
piece of code gives all sorts of errors.
so important note: this will perform worse than the automatic
allocation, which just puts it down in-place. You should
basically
I'm doing this mainly for experimentation, but the following
piece of code gives all sorts of errors. Hangs, segfaults or
prints nothing and exits
import std.stdio;
import core.stdc.stdlib;
void main()
{
auto f = cast(File *) malloc(File.sizeof);
*f = File("test.txt", "r");