Optimizing constructors/destructors for embedded systems
Daniel Lohmann
daniel.lohmann@informatik.uni-erlangen.de
Mon Jun 25 12:29:00 GMT 2007
Kövesdi György wrote:
> Hi,
>
> In addition to wasting space, creating unnecessary instances of destructors
> may lead to other problems (especially for embedded systems): some
> destructors call the operator delete(void*). So, the corresponding libraries
> will be linked in the resulting code. Some amount of space could be saved
> avoiding the use of operators new() and delete(). It would be useful to be
> able to disable those destructors somehow.
1) I am not sure if I understand your problem. Can you give an exampel
for such an (automatically generated) destructore that implicitly calls
delete?
2) If they aren't necessary anyway, why don't you just provide your own
(empty) implementations of new and delete to avoid the inclusion of
whatever runtime library?
Daniel
More information about the Gcc-help
mailing list