Mail Archives: djgpp/2001/01/25/12:51:45
Hans-Bernhard Broeker <broeker AT physik DOT rwth-aachen DOT de> schrieb folgenden Unsinn:
> Rudolf Polzer <rpolzer AT web DOT de> wrote:
> > Hans-Bernhard Broeker <broeker AT physik DOT rwth-aachen DOT de> schrieb folgenden Unsinn:
> >> Compared to both of these, ME is a pain in the lower back as it comes
> >> to advanced DJGPP usage. Just as an example, you'll have no way of
> >> using the full power of the YAMD memory debugger on an ME system
> >> without applying that highly unofficial patch to re-enable the real
> >> MS-DOS sleeping inside it.
>
> > But that is no argument:
> > 1. if you are still programming in C it's no "advanced DJG_PP_ usage"
>
> Please note that the _PP_ in DJGPP has absolutely nothing to do with
> C++. Advanced usage to me means that you're a programmer who expects
> more from a programming toolchain than just building programs.
> Debugging tools like YAMD are advanced, in that sense.
Of course they are, but they are not really C++ compatible. And what else
does the PP in GPP stand for except "Plus Plus"? It does not stand for
"PreProcessor" since the C compiler part is GCC, and CPP is the C
preprocessor, not GPP.
> > 2. if you are programming in C++, an overloaded operator new() and
> > operator delete() will do.
>
> You don't seem to have understood what YAMD really is, yet. YAMD is
> better than anything you can do by redefining new()/delete() or
> malloc()/free(), by a wide margin. No redefined allocation operator
> will allow you to detect not only that, but *when* and *where* an
> allocated buffer was overrun.
Overruns do not occur in C++ code, the STL checks everything (including
wrong indices of a vector). Only poor-style C++ code (or system-level code
which then is in C) uses C arrays, malloc and free.
The only memory allocation problems that really can occur in C++ are NULL
pointers (caught by the processor => SIGSEGV) and memory leaks (then you
can try redefining operators).
--
Nuper erat medicus, nunc est vispillo, Diaulus:
Quod vispillo facit, fecerat et medicus.
- Raw text -