httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ryan Bloom <...@raleigh.ibm.com>
Subject Re: cvs commit: apache-2.0/src/lib/apr/lib apr_execve.c apr_pools.c apr_tables.c
Date Wed, 24 Nov 1999 15:12:19 GMT

I like this.  I may clean it up a bit before I commit it, and I'll have to
write a small little function to set the function pointer.  Expect to see
it later today or tomorrow sometime (I'll have a lot of time in the
airport and on the plane tomorrow morning to code).

Greg, it's good to know you are out there making my life a royal PITA,
because everytime you jump on me for doing something, we come up with a
bit more flexible code.  :-)

Ryan

On Wed, 24 Nov 1999, Greg Stein wrote:

> On Wed, 24 Nov 1999, Ryan Bloom wrote:
> > > How about using something like the C++ method where you can register an out
> > > of memory handler function (set_new_handler())? That way Apache can register
> > > a handler that does the log & abort step without forcing all APR using
apps
> > > to have the same behaviour.
> > 
> > I could live with that, presuming that the APR default is to jut return an
> > error code.  If Apache wants to over-write that default, then fine.  I
> > won't get to this code until after Thanksgiving, because I want to get
> > everybodies reaction first.
> 
> You could probably do something like this:
> 
> #define ap_memory_error(ctx)  ((ctx) != NULL \
>                                && (ctx)->notify_no_memory != NULL \
>         ? (*(ctx)->notify_no_memory)(ctx)    \
>         : APR_ENOMEMORY)
> 
> (of course, it could be a real function, too)
> 
> Code would then look like:
> 
>   p = malloc(foo);
>   if (p == NULL)
>     return ap_memory_error(ctx);
>   p->bar = baz;
>   ...
> 
> 
> Seem reasonable?
> 
> Cheers,
> -g
> 
> -- 
> Greg Stein, http://www.lyra.org/
> 

_______________________________________________________________________
Ryan Bloom		rbb@raleigh.ibm.com
4205 S Miami Blvd	
RTP, NC 27709		It's a beautiful sight to see good dancers 
			doing simple steps.  It's a painful sight to
			see beginners doing complicated patterns.	


Mime
View raw message