Re: From the D Blog -- Interfacing D with C: Strings Part One

2021-05-24 Thread surlymoor via Digitalmars-d-announce
On Tuesday, 25 May 2021 at 00:58:31 UTC, Steven Schveighoffer wrote: OK, I'm just concerned people will see the pattern: ```d somecfunc(str.toStringz); ``` and think that's the end of it. -Steve Pretty sure its documentation has a conspicuous warning regarding that.

Re: From the D Blog -- Interfacing D with C: Strings Part One

2021-05-24 Thread Steven Schveighoffer via Digitalmars-d-announce
On 5/24/21 8:38 PM, Mike Parker wrote: On Monday, 24 May 2021 at 16:16:53 UTC, Steven Schveighoffer wrote: This leaves a GC-collectible allocation in C land. For `puts`, it's fine, as the data is not used past the call, but in something else that might keep it somewhere not accessible to the

Re: From the D Blog -- Interfacing D with C: Strings Part One

2021-05-24 Thread zjh via Digitalmars-d-announce
switch to ie. other websites is no problem. I don't know why.

Re: From the D Blog -- Interfacing D with C: Strings Part One

2021-05-24 Thread Mike Parker via Digitalmars-d-announce
On Monday, 24 May 2021 at 16:16:53 UTC, Steven Schveighoffer wrote: Nice article! Thanks! Note that there is a huge pitfall awaiting you if you use `toStringz`: garbage collection. You may want to amend the article to identify this pitfall. And I'm not talking about requiring

Re: From the D Blog -- Interfacing D with C: Strings Part One

2021-05-24 Thread John Colvin via Digitalmars-d-announce
On Monday, 24 May 2021 at 16:16:53 UTC, Steven Schveighoffer wrote: On 5/24/21 10:02 AM, Mike Parker wrote: The latest post in the D and C series dives into the weeds of D and C strings: how they're implemented, when you need to NUL-terminate your D strings and when you don't, and how the

Re: From the D Blog -- Interfacing D with C: Strings Part One

2021-05-24 Thread Steven Schveighoffer via Digitalmars-d-announce
On 5/24/21 10:02 AM, Mike Parker wrote: The latest post in the D and C series dives into the weeds of D and C strings: how they're implemented, when you need to NUL-terminate your D strings and when you don't, and how the storage of literals in memory allows you to avoid NUL termination in one

Re: From the D Blog -- Interfacing D with C: Strings Part One

2021-05-24 Thread rikki cattermole via Digitalmars-d-announce
On 25/05/2021 3:39 AM, zjh wrote: use chrome ,cannot open the DEV. press `F12` of no use. `Alt+U`of no use. continue rotating the small circle.You can do nothing. There is something seriously wrong with your install then. It isn't related to the website itself.

Re: From the D Blog -- Interfacing D with C: Strings Part One

2021-05-24 Thread rikki cattermole via Digitalmars-d-announce
Use the dev tools, network + performance tabs could be very useful information for debugging this.

Re: From the D Blog -- Interfacing D with C: Strings Part One

2021-05-24 Thread zjh via Digitalmars-d-announce
use chrome ,cannot open the DEV. press `F12` of no use. `Alt+U`of no use. continue rotating the small circle.You can do nothing.

Re: From the D Blog -- Interfacing D with C: Strings Part One

2021-05-24 Thread zjh via Digitalmars-d-announce
but ie can open it. it's strange.

Re: From the D Blog -- Interfacing D with C: Strings Part One

2021-05-24 Thread zjh via Digitalmars-d-announce
loading all the time, loading for a long time, but also only part of the load, and still turn the circle. just like there is a BIG `js` file .

Re: From the D Blog -- Interfacing D with C: Strings Part One

2021-05-24 Thread sighoya via Digitalmars-d-announce
On Monday, 24 May 2021 at 14:02:14 UTC, Mike Parker wrote: The latest post in the D and C series dives into the weeds of D and C strings: Thanks, I wasn't even aware of this. However, I wish the behavior would be the same between string bounded storage variables and string literals. I think

Re: From the D Blog -- Interfacing D with C: Strings Part One

2021-05-24 Thread Mike Parker via Digitalmars-d-announce
On Monday, 24 May 2021 at 15:10:46 UTC, sighoya wrote: There are at least two more posts worth of information to go into on this topic, but everything in this post is enough to cover many use cases of D to C string interop. Which posts did you think of? I describe them in the Conclusion:

Re: From the D Blog -- Interfacing D with C: Strings Part One

2021-05-24 Thread Mike Parker via Digitalmars-d-announce
On Monday, 24 May 2021 at 15:03:20 UTC, zjh wrote: I always think there is something wrong with the JS of ` D blog site`. I can't use chrome to open it. I'm looking at it in Chrome right now. Are you saying it doesn't open at all for you or there are rendering issues, or...?

Re: From the D Blog -- Interfacing D with C: Strings Part One

2021-05-24 Thread zjh via Digitalmars-d-announce
I always think there is something wrong with the JS of ` D blog site`. I can't use chrome to open it.

Re: From the D Blog -- Interfacing D with C: Strings Part One

2021-05-24 Thread zjh via Digitalmars-d-announce
I always think there is something wrong with the JS of ` D blog site`. I can't use chrome to open it.

From the D Blog -- Interfacing D with C: Strings Part One

2021-05-24 Thread Mike Parker via Digitalmars-d-announce
The latest post in the D and C series dives into the weeds of D and C strings: how they're implemented, when you need to NUL-terminate your D strings and when you don't, and how the storage of literals in memory allows you to avoid NUL termination in one case you might not have considered and