sjlj exception and malloc

Jeffrey A Law law@cygnus.com
Mon Oct 19 11:01:00 GMT 1998


  In message < 199810160336.UAA20601@monterey.sierravista.com >you write:
  > When using sjlj exceptions, malloc gets called very early in order to
  > allocate the static eh context.  This is a real problem for us because
  > we implement our own malloc in C++.  The result is infinite recursion.
  > 
  > Because there is only one of these static objects, it's straightforward
  > to statically allocate the object and then just do the initialization,
  > which breaks the loop.  I've observed no negative side effects other
  > than the 12 bytes of data space that aren't used when eh_context_static
  > isn't used.
I fixed this in a slightly different (cleaner & more efficient) manner.

Thanks for pointing out the problem.

jeff



More information about the Gcc mailing list