This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: debug extension overhead


Benjamin Kosnik <bkoz@redhat.com> writes:
> 
> > Have you considered adding a knob that would turn on a subset of
> > _GLIBCXX_DEBUG checks that have lower overhead, e.g., guaranteed
> > constant factor?  Some users are giving up on it due to high overhead
> > in certain cases, but they could benefit from cheap checks, such as
> > vector subscript checks.  
> 
> Hmm. The idea was that for fine-grained checks, one would just select
> the debug extension on a per-header basis, instead of using
> _GLIBCXX_DEBUG. Ie, including debug/vector and
> using __gnu_debug::vector if all you want is vector subscript checks.

Does this work in practice?  I haven't tried, but:

  ... you can only link code compiled with debug mode and code compiled
  without debug mode if no instantiation of a container is passed
  between the two translation units. [1]

implies that doing so in a large application would be very difficult,
unless you didn't use containers as part of your interfaces.

-tom

[1] http://gcc.gnu.org/onlinedocs/libstdc++/manual/bk01pt12ch30s03.html#debug_mode.using.specific


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]