From: bokiteam on
Hi All,

Here are some routine, I can't understand what are they doing:

/*
Panics the application unconditionally.
*/
void Panic(void);

/*
Allocates sz words and returns a pointer to the memory if successful.
If
the memory allocation fails, the application is panicked.
*/
void *PanicUnlessMalloc(size_t sz);


What is panic here?

"..., the application is panicked."

so ? what will happen?

Could you please advice?

Thank you very much!

Best regards,
Boki.

From: Vince Morgan on

<bokiteam(a)ms21.hinet.net> wrote in message
news:1136525525.941319.325500(a)z14g2000cwz.googlegroups.com...
> Hi All,
>
> Here are some routine, I can't understand what are they doing:
>
> /*
> Panics the application unconditionally.
> */
> void Panic(void);

This is a declaration of a funct, without seeing the implementation it's not
possible to say what it does.

>
> /*
> Allocates sz words and returns a pointer to the memory if successful.
> If
> the memory allocation fails, the application is panicked.
> */
> void *PanicUnlessMalloc(size_t sz);
>

Same here.

>
> What is panic here?
>
> "..., the application is panicked."
>
> so ? what will happen?
>
> Could you please advice?

With all due respect, there isn't nearly enough information to answer
anything you are asking here.

--
HTH
Vince Morgan
Remove UNSPAM
vinhar(a)UNSPAMoptusnet.com.au


From: Aggro on
bokiteam(a)ms21.hinet.net wrote:

> What is panic here?
>
> "..., the application is panicked."
>
> so ? what will happen?

We don't know as we didn't actually see the code, only the function
name, return value and parameters. It was like showing a person a house
from the outside then ask him/her to describe what is in the house.
From: osmium on
<bokiteam(a)ms21.hinet.net> wrote:

> Here are some routine, I can't understand what are they doing:
>
> /*
> Panics the application unconditionally.
> */
> void Panic(void);
>
> /*
> Allocates sz words and returns a pointer to the memory if successful.
> If
> the memory allocation fails, the application is panicked.
> */
> void *PanicUnlessMalloc(size_t sz);
>
>
> What is panic here?
>
> "..., the application is panicked."
>
> so ? what will happen?
>
> Could you please advice?

If you type panic as a search target into Google, there will be a blue
option to provide a definition of the word near the top of the screen.
Click on that choice. I intrepret it as meaning the same thing as
abort_if_fail(...).

The name of the function suggests that the function exits and releases
control back to the OS. Look in the code for calls on exit() or an oddly
placed return.


From: bokiteam on
I don't have more information either.

It is a embedded code.

I just guess it is often use in C++ coding...

btw, thanks a lot.

Best regards,
Boki.

 |  Next  |  Last
Pages: 1 2 3 4
Prev: how to convert integer to string
Next: reinterpret_cast