Re: How the GC distinguishes code from data

2011-01-05 Thread %u
> If you have allocated a large uint[], most likely =C3=ACt will be flagged NO_SCAN, meaning it has no pointers in it, and the GC will ignore it. Ah, but the trouble is, no one said that this array has to be in the GC heap! I could easily have a void[] and a uint[] that both point to non-GC manag

Re: How the GC distinguishes code from data

2011-01-05 Thread Steven Schveighoffer
On Wed, 05 Jan 2011 16:56:47 -0500, Simen kjaeraas wrote: %u wrote: If I have a large uint[], it's practically guaranteed to have data that looks like pointers, and that might cause memory leaks. If you have allocated a large uint[], most likely ìt will be flagged NO_SCAN, meaning it ha

Re: How the GC distinguishes code from data

2011-01-05 Thread Simen kjaeraas
%u wrote: Hi, There's a question that's been lurking in the back of my mind ever since I learned about D: How does the GC distinguish code from data when determining the objects to collect? (E.g. void[] from uint[], size_t from void*, etc.?) This is hardly the code/data dualism (data c

How the GC distinguishes code from data

2011-01-05 Thread %u
Hi, There's a question that's been lurking in the back of my mind ever since I learned about D: How does the GC distinguish code from data when determining the objects to collect? (E.g. void[] from uint[], size_t from void*, etc.?) If I have a large uint[], it's practically guaranteed to have da

Re: Asian characters are not printed propely in console

2011-01-05 Thread bearophile
Vladimir Panteleev: > This code should really be in the standard library, I think. File a bug report, with a little patch, then :-) Bye, bearophile

Re: Asian characters are not printed propely in console

2011-01-05 Thread torhu
On 04.01.2011 10:47, Jun wrote: I'm sorry for posting in the wrong place. I attached screenshot of my code and the result. As you can see, Korean letters get changed after compilation. This problem doesn't happen with user input(from readln() method). Should I use different type and prefix or

Re: Initialising arrays at compile time

2011-01-05 Thread bearophile
so: > "static enum" makes no sense, shouldn't it be an error? Currently the way D/DMD manages attributes and the like is so sloppy that it seems trash. But there are always more important things to do and fix, so no care is given on this problem: http://d.puremagic.com/issues/show_bug.cgi?id=39

Re: Wide characters are not printed properly

2011-01-05 Thread Jesse Phillips
Jun Wrote: > Thank you for the answer, Vladimir, but it didn't work. The code page of my > console was 949 which supports Korean characters. I tested with french and e > with ` (I don't know its name)was not printed properly. Both wstring dstring > resulted the same problem. I believe you need to

Re: Initialising arrays at compile time

2011-01-05 Thread so
(I think that "enum" and "static enum" are the same thing.) "static enum" makes no sense, shouldn't it be an error? -- Using Opera's revolutionary email client: http://www.opera.com/mail/

Wide characters are not printed properly

2011-01-05 Thread Jun
Thank you for the answer, Vladimir, but it didn't work. The code page of my console was 949 which supports Korean characters. I tested with french and e with ` (I don't know its name)was not printed properly. Both wstring dstring resulted the same problem.