tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] tcc problems on FBSD 4.8 and patch


From: Billy
Subject: Re: [Tinycc-devel] tcc problems on FBSD 4.8 and patch
Date: Tue, 22 Apr 2003 14:50:47 -0700
User-agent: Mutt/1.4i

On Tue, Apr 22, 2003 at 11:06:30PM +0200, Peter Firefly Lund wrote:
> > >  #ifndef CONFIG_TCC_MALLOC_HOOKS
> > > -void *__bound_calloc(size_t nmemb, size_t size)
> > > +void *__bound_calloc(size_t nmemb, size_t size, const void *caller)
> > >
> > > Perhaps __const would be better?  The bounds checking code is very tightly
> > > bound to the memory allocator used in glibc (ptmalloc, derived from Doug
> > > Lea's malloc) and it uses __const -- defined in malloc.h.
> >
> > I wasn't really thinking about changing the sematics of the code, only
> > changing the syntax to compile on FreeBSD.  This patch really only for
> > platform portability.
> 
> Using __const instead of const for the hooked functions doesn't seem like
> changing the semantics to me.  You must have a glibc like malloc module
> anyway for it to work.
> 
> (__malloc_hook and friends are defined in malloc.h)

Actually no.  FreeBSD doesn't use glib (unless you have linux compat
installed).  __const is declared in sys/cdefs.h, but your supposed
include it useing stdlib.h.  malloc.h is deprecated on freebsd.

-billy





reply via email to

[Prev in Thread] Current Thread [Next in Thread]