Thread overview
How to exit a process?
Dec 06, 2010
Adam Ruppe
Dec 06, 2010
Andrej Mitrovic
Dec 07, 2010
Adam Ruppe
Dec 06, 2010
spir
Dec 07, 2010
Stanislav Blinov
December 06, 2010
Is there a thing like C's exit() for a D program? Is
simply using C's function good enough?
December 06, 2010
I usually use assert(0) when I want to forcefully exit a program. It's compiled in both debug/release modes.

On 12/6/10, Adam Ruppe <destructionator@gmail.com> wrote:
> Is there a thing like C's exit() for a D program? Is
> simply using C's function good enough?
>
December 06, 2010
On Mon, 06 Dec 2010 14:11:59 -0500, Adam Ruppe <destructionator@gmail.com> wrote:

> Is there a thing like C's exit() for a D program? Is
> simply using C's function good enough?

Yes, it will work.

Note that it does not gracefully shut down a process.  Anything outside the process that is left in an intermediate state will not be cleaned up.

For instance, if you created a lock file, it will remain.

But in general, it's safe to use, the OS will clean up the memory and open handles, etc.

-Steve
December 06, 2010
On Mon, 6 Dec 2010 19:11:59 +0000 (UTC)
Adam Ruppe <destructionator@gmail.com> wrote:

> Is there a thing like C's exit() for a D program? Is
> simply using C's function good enough?

I use:
	import core.stdc.stdlib : exit;
	// debug tool func
	void stop () {exit(0);}

denis
-- -- -- -- -- -- --
vit esse estrany ☣

spir.wikidot.com

December 07, 2010
Thanks, everyone. I wasn't using any resources that
needed explicit cleanup (no scope exits etc) so I just
used the C exit and it worked well.
December 07, 2010
06.12.2010 22:11, Adam Ruppe пишет:
> Is there a thing like C's exit() for a D program? Is
> simply using C's function good enough?
>
Also take a look at core.runtime.Runtime.terminate()