current cvs segfault on Debian hppa

Gyepi SAM gyepi at praxis-sw.com
Thu Oct 3 20:37:06 CEST 2002


On Thu, Oct 03, 2002 at 10:47:47AM -0700, Mark M. Hoffman wrote:
 
> I looked at this for a while last night... seems to me that combining 
> hmalloc calls is ok.  I suspect the problem is in combining xmalloc
> calls deeper down, especially calling for more than you need and saving
> some for later.  There is no need to wrap malloc/xmalloc this way.  The
> malloc routine already avoids calling sbrk (or whatever syscall is down
> there for your machine) which is the *real* expensive part.  If you only
> malloc what you can immediately use, you don't have to worry about align-
> ment at all.  Then...
> 
> p = malloc(sizeof(struct foo) + n + m);
> 
> Where n and m are byte buffer sizes should be portable and is indeed
> more efficient.

You're probably right. Once the immediate problem is solved, I'll look at combining the calls
again.

My benchmarking showed the combined calls to be only slightly faster than the separate ones. 

-Gyepi

-- 
Against logic there is no armor like ignorance.
	--Laurence J. Peter  



More information about the bogofilter-dev mailing list