From: Enblend <enb...@li...> - 2013-02-15 14:24:48
|
branch: details: http://enblend.hg.sourceforge.net/hgweb/enblend/enblend/hg/p/enblend/code/rev/27edd6c31bd2 changeset: 896:27edd6c31bd2 user: Chris <cs...@us...> date: Fri Feb 15 15:00:21 2013 +0100 description: Remove calls to alloca(3) as they turned out to be unreliable. We prefer the C++ language standard memory management functions new[] and delete[] instead. This patch reverts changes e8cc39823dc5 and 19a149291c0c. diffstat: ConfigureChecks.cmake | 2 +- VERSION | 2 +- config.h.cmake | 4 ---- configure.in | 1 - doc/enblend.info | Bin doc/enfuse.info | Bin src/openmp.h | 24 +++--------------------- 7 files changed, 5 insertions(+), 28 deletions(-) diffs (96 lines): diff -r ca454db9f33c -r 27edd6c31bd2 ConfigureChecks.cmake --- a/ConfigureChecks.cmake Sun Jan 27 09:33:42 2013 +0100 +++ b/ConfigureChecks.cmake Fri Feb 15 15:00:21 2013 +0100 @@ -24,7 +24,7 @@ "OpenGL/glu.h" "OpenGL/gl.h" "inttypes.h" "limits.h" "memory.h" "stdint.h" "stdlib.h" "stdbool.h" "strings.h" "string.h" - "sys/stat.h" "sys/types.h" "unistd.h" "windows.h" "alloca.h") + "sys/stat.h" "sys/types.h" "unistd.h" "windows.h") string(REGEX REPLACE "[/\\.]" "_" _var ${_fl}) string(TOUPPER "${_var}" _FLN) check_include_file_cxx("${_fl}" "HAVE_${_FLN}" ) diff -r ca454db9f33c -r 27edd6c31bd2 VERSION --- a/VERSION Sun Jan 27 09:33:42 2013 +0100 +++ b/VERSION Fri Feb 15 15:00:21 2013 +0100 @@ -1,1 +1,1 @@ -4.2-f645e5f18a45 +4.2-befc59f3228c diff -r ca454db9f33c -r 27edd6c31bd2 config.h.cmake --- a/config.h.cmake Sun Jan 27 09:33:42 2013 +0100 +++ b/config.h.cmake Fri Feb 15 15:00:21 2013 +0100 @@ -140,10 +140,6 @@ /* Define to 1 if you have the <windows.h> header file. */ #cmakedefine HAVE_WINDOWS_H 1 -/* Define to 1 if you have the <allocoa.h> header file. - */ -#cmakedefine HAVE_ALLOCOA_H 1 - /* Define to 1 if the system has the type `_Bool'. */ /* #undef HAVE__BOOL */ diff -r ca454db9f33c -r 27edd6c31bd2 configure.in --- a/configure.in Sun Jan 27 09:33:42 2013 +0100 +++ b/configure.in Fri Feb 15 15:00:21 2013 +0100 @@ -334,7 +334,6 @@ AC_CHECK_TYPES([ptrdiff_t]) # Checks for library functions. -AC_FUNC_ALLOCA AC_FUNC_CLOSEDIR_VOID AC_FUNC_FSEEKO # AC_FUNC_MALLOC dnl unused and harmful when cross compiling diff -r ca454db9f33c -r 27edd6c31bd2 doc/enblend.info Binary file doc/enblend.info has changed diff -r ca454db9f33c -r 27edd6c31bd2 doc/enfuse.info Binary file doc/enfuse.info has changed diff -r ca454db9f33c -r 27edd6c31bd2 src/openmp.h --- a/src/openmp.h Sun Jan 27 09:33:42 2013 +0100 +++ b/src/openmp.h Fri Feb 15 15:00:21 2013 +0100 @@ -47,24 +47,6 @@ #define OPENMP_MONTH (_OPENMP % 100) -#if defined(HAVE_ALLOCA_H) -#include <alloca.h> -#elif defined(__GNUC__) -#define alloca __builtin_alloca -#elif defined(_AIX) -#define alloca __alloca -#elif defined(_MSC_VER) -#include <malloc.h> -#define alloca _alloca -#else -#include <stddef.h> -#if defined(__cplusplus) -extern "C" -#endif -void* alloca(size_t); -#endif - - namespace omp { inline static void* malloc(size_t) __attribute__((alloc_size(1), malloc)); @@ -75,17 +57,17 @@ #ifdef __ICC return kmp_malloc(size); #else - return alloca(size); + return new char[size]; #endif } inline static void - free(void* __attribute__((unused)) pointer) + free(void* pointer) { #ifdef __ICC kmp_free(pointer); #else - ; // empty + delete [] static_cast<char*>(pointer); #endif } |