What does run-time support exactly mean?

M

muler

hi,

what does this exactly mean:

"Except for the new, delete, typeid, dynamic_cast, and throw operators
and the try-block, individual C++ expressions and statements need no
run-time support." TC++PL § 1.3.1

thanks,
Mulugeta
 
S

Stuart Redmann

muler said:
hi,

what does this exactly mean:

"Except for the new, delete, typeid, dynamic_cast, and throw operators
and the try-block, individual C++ expressions and statements need no
run-time support." TC++PL § 1.3.1

I would interpret this in the following way: Most C++ statements can be
translated into a sequence of architecture-specific machine instructions which
consume a fixed amount of time (or to say it in other words, the work the
processor has to do in order to process the C++ statement does not depend on
some internal state of the application).

Some C++ expressions can only get translated into machine instructions that
require some computations based on internal states of the application. For
example the operators new and delete must work on the free-lists that are
internally kept by the C++ run-time environment (how a particular C++ compiler
manages it memory is of course an implementation detail we do not need to care
about, but it is nevertheless good to know what happens behind the scenes). Thus
it may take more or less work for the computer to process a new or delete
request; it depends on the state of the free-lists.

I don't know whether TC++PL § 1.3.1 also means that a C++ programme written
without using the mentioned features of the C++ language won't need to be linked
against the C++ run-time library (which is another platform specific detail, I
guess). I tried this with a simple application on MS Visual C but it complains
that is doesn't find _mainCRTStartup.

Regards,
Stuart
 
E

Erik Wikström

I would interpret this in the following way: Most C++ statements can be
translated into a sequence of architecture-specific machine instructions which
consume a fixed amount of time (or to say it in other words, the work the
processor has to do in order to process the C++ statement does not depend on
some internal state of the application).

Some C++ expressions can only get translated into machine instructions that
require some computations based on internal states of the application. For
example the operators new and delete must work on the free-lists that are
internally kept by the C++ run-time environment (how a particular C++ compiler
manages it memory is of course an implementation detail we do not need to care
about, but it is nevertheless good to know what happens behind the scenes). Thus
it may take more or less work for the computer to process a new or delete
request; it depends on the state of the free-lists.

I don't know whether TC++PL § 1.3.1 also means that a C++ programme written
without using the mentioned features of the C++ language won't need to be linked
against the C++ run-time library (which is another platform specific detail, I
guess). I tried this with a simple application on MS Visual C but it complains
that is doesn't find _mainCRTStartup.

As you said it is an implementation detail, but in general it means that
if you do not use it you do not have to pay for it. Notice though that
the CRT is more than just RTTI, exceptions, and memory management.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top