search for: safe_malloc_

Displaying 4 results from an estimated 4 matches for "safe_malloc_".

Did you mean: safe_malloc
2007 Sep 11
2
include/share/alloc.h
Josh, I noticed the recent addition of the above file. In that file you have things like: static void *safe_malloc_(size_t size) { /* malloc(0) is undefined; FLAC src convention is to always allocate */ if(!size) size++; return malloc(size); } Did you meant to have an "inline" in there to make it: static inline void *safe_malloc_(size_t size) By making...
2007 Sep 11
0
include/share/alloc.h
--- Erik de Castro Lopo <erikd-flac@mega-nerd.com> wrote: > Josh, > > I noticed the recent addition of the above file. In that file you > have > things like: > > static void *safe_malloc_(size_t size) > { > /* malloc(0) is undefined; FLAC src convention is to always > allocate */ > if(!size) > size++; > return malloc(size); > } > > Did you meant to have an "inline" in there to make it: > > s...
2012 Jun 24
3
Patch for cross compilation with MinGW32
...w32msvc --target=i586-mingw32msvc --build=i586-linux but ran into several linker problems. Are these options somehow wrong? It worked fine when I compiled libogg-0.dll. Anyway, I attached a patch to allow cross compilation with MinGW32 on my machine again: First, I moved the implementation of *safe_malloc_mul_2op_ to alloc.h, just like all the other alloc implementations, and removed the thereby obsolete alloc.c implementation from grabbag. Second, I just wrapped FLAC__clz_soft_uint32 with an #ifndef __MINGW32__. I tested the patch for both Linux and MinGW32 compiles, and both result in functiona...
2012 May 05
5
[PATCH] Optionally, allow distros to use openssl for MD5 verification
...on. + */ +#if defined(_MSC_VER) +/* see http://msdn.microsoft.com/en-us/library/5471dc8s(v=vs.80).aspx for the rationale */ + FLAC__byte *tmp = _malloca(bytes_needed); +#else + const FLAC__bool usealloca = (bytes_needed < 4032); + FLAC__byte *tmp = usealloca ? alloca(bytes_needed) : safe_malloc_(bytes_needed); +#endif + format_input_(tmp, signal, channels, samples, bytes_per_sample); + const FLAC__bool retval = (EVP_DigestUpdate(ctx, tmp , bytes_needed) == 1); +#if defined(_MSC_VER) + _freea(tmp) +#else + if(!usealloca) free(tmp); +#endif + return retval; +#else if(ctx-&...