Bug 4332 – C files in druntime should be converted to D

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
druntime
Product
D
Version
D2
Platform
Other
OS
Windows
Creation time
2010-06-16T13:12:00Z
Last change time
2012-10-10T11:54:00Z
Assigned to
sean
Creator
clugdbug

Attachments

IDFilenameSummaryContent-TypeSize
893critical.dD implementation of critical.ctext/plain1095
894monitor.dD implementation of monitor.ctext/plain2455
895win32.makChanged monitor.c and critical.c into Dtext/plain22704
896win32.makChanged monitor.c and critical.c into Dtext/plain22704
897critical.dD implementation of critical.dtext/plain5252
898monitor.dD implementation of monitor.dtext/plain6837

Comments

Comment #0 by clugdbug — 2010-06-16T13:12:23Z
complex.c, critical.c, deh.c, monitor.c, and memory_osx.c should all be converted to D eventually. And D is a much better language for doing systems programming anyway <g>.
Comment #1 by nfxjfg — 2010-06-17T02:53:30Z
Same for minit.asm and tls.S. If the inline assembler can't do it, it obviously has to be extended to support the missing features (such defining global symbols and sections).
Comment #2 by wfunction — 2011-02-01T13:22:31Z
Created attachment 893 D implementation of critical.c
Comment #3 by wfunction — 2011-02-01T13:23:06Z
Created attachment 894 D implementation of monitor.c
Comment #4 by wfunction — 2011-02-01T13:24:52Z
Created attachment 895 Changed monitor.c and critical.c into D
Comment #5 by wfunction — 2011-02-01T13:25:27Z
Created attachment 896 Changed monitor.c and critical.c into D
Comment #6 by wfunction — 2011-02-01T17:07:42Z
Created attachment 897 D implementation of critical.d I tried to leave the POSIX code in this time, even though I haven't tested it. Hopefully this version is better, but apparently _d_criticalInit() needs to be modified as well.
Comment #7 by wfunction — 2011-02-01T17:08:36Z
Created attachment 898 D implementation of monitor.d I tried to leave the POSIX code in this time, even though I haven't tested it. Hopefully this version is better, but apparently _d_criticalInit() needs to be modified as well.
Comment #8 by ibuclaw — 2011-02-03T16:44:55Z
Have taken the liberty of fixing Posix code, and pushed here: https://github.com/ibuclaw/druntime/commit/4a2b70aea1df0cc4550b151b82f19655b5903279 Thanks!
Comment #9 by braddr — 2011-02-06T23:38:00Z
Something is wrong with the win32 conversion of monitor.c to monitor_.d. I merged Iain's version of the changes earlier today but it broke the win32 build and tests. So, I reverted just win32 back to using the C version. If one of you cooks up fixes, I'll be happy to re-test and merge them. Thanks, Brad
Comment #10 by braddr — 2011-02-07T01:15:44Z
Further testing (dmd's test34) showed that the critical .c to .d change needed to be reverted as well. Win32 is back to using the .c version for both files now.
Comment #11 by ibuclaw — 2011-02-07T16:51:50Z
Strange... Are there any reasonable debuggers for Windows? I must admit I'm rather terrible on the platform, but I could have a bash at seeing what's up, and why it doesn't work (when Linux is just fine and dandy).
Comment #12 by ibuclaw — 2011-02-15T10:21:44Z
(In reply to comment #11) > Strange... > > Are there any reasonable debuggers for Windows? I must admit I'm rather > terrible on the platform, but I could have a bash at seeing what's up, and why > it doesn't work (when Linux is just fine and dandy). After a week of learning and painful struggling, I give up on Windows. Anyone else with better know-how willing to fix this? Regards
Comment #13 by hoganmeier — 2011-02-18T05:17:32Z
I think cv2pdb + Visual Studio is the only nice and working way to debug D on Windows. Which test was broken by monitor_.d?
Comment #14 by ibuclaw — 2011-02-18T08:05:04Z
Compile in both critical_ and monitor_ and *any* application built won't reach main. It crashes in _d_monitorenter in object_.d _d_monitor_create(h); m = getMonitor(h); <-- Here as far as I could tell. Good luck! :)
Comment #15 by ibuclaw — 2011-02-25T13:36:21Z
I'm just gonna throw it out there that upon compiling GDC2 on MinGW, the D implementations of monitor and critical do not cause any problems on the platform. Regards
Comment #16 by alex — 2012-10-09T18:43:03Z
This is now done.
Comment #17 by dmitry.olsh — 2012-10-10T00:37:00Z
While I know little of druntime internals I don't think this was delt with. Why are critical.c and monitor.c still here in the repository then? Also Win32 section of monitor_.d is currently commented out.
Comment #18 by alex — 2012-10-10T07:25:14Z
(In reply to comment #17) > While I know little of druntime internals I don't think this was delt with. > Why are critical.c and monitor.c still here in the repository then? Also Win32 > section of monitor_.d is currently commented out. I don't know where you are seeing these files. They are not there in my clone.
Comment #19 by alex — 2012-10-10T07:26:50Z
Comment #20 by dmitry.olsh — 2012-10-10T11:53:27Z
(In reply to comment #19) > See: https://github.com/D-Programming-Language/druntime/tree/master/src/rt > > Closing again. Okay. Sorry for the confusion. Must have pulled stuff from my outdated clone.
Comment #21 by alex — 2012-10-10T11:54:00Z
No prob!