Hi,
currently using dynamic arrays (which implicitly uses alloca()) is used
by default
with heap allocation via new/delete as fallback if the compiler does not
support
dynamic arrays.
I guess that is good enough (as a GNU maintainer I feel like there there
should be
a small performance
Hi,
I hope the Solaris issues are fixed now (SVN 187). Please complain if not.
I decided against alloca() because the description on its man page
suggested more problems than advantages.
/// Jürgen
On 04/03/2014 02:55 PM, Elias Mårtenson wrote:
It would, but OpenMP is not supported on it.
Usually the stack frame has a platform specific (!!!) size. If you overflow the stack return adress, stack pointers etc maybe fuzzed.
It is generally a bad idea with heritage from the old VAXen era. IIRC Richie even wrote a paper on dymanic array allocation in the mid-80ies.
Code is bigger and
With 20+ years C experience, IMO using alloca() as a way of allocating
computed sized arrays is good. There are other speed advantages of using
alloca too. Like many C library calls, alloca only works because of the
fact that it is specifically designed to work with a specific tool chain.
That's
As it turns out, I must use the Solaris Studio compiler to take advantage
of OpenMP on Solaris. This compiler is much more picky in terms of not
allowing certain non-standard constructs.
Here are the problems I've had:
*Enum values must be a long or unsigned long*
In SystemLimits.hh, LARGE_INT
On 2 April 2014 18:32, Elias Mårtenson loke...@gmail.com wrote:
Declaring an array with a size computed at runtime is not actually allowed
(it's supported in modern C, and also supported in C++ as an extension).
What I meant was that it's supported in *GCC* as an extension, not C++.
Regards,
Oh, and there are a few more dynamically sized arrays:
- phrase_gen.cc:115 and 222
Regards,
Elias
On 2 April 2014 18:34, Elias Mårtenson loke...@gmail.com wrote:
On 2 April 2014 18:32, Elias Mårtenson loke...@gmail.com wrote:
Declaring an array with a size computed at runtime is not
Also, if you want to try out the Solaris compiler, it's available for free
for Linux as well:
http://www.oracle.com/technetwork/server-storage/solarisstudio/beta-1947596.html
To enable OpenMP you need to compile with *-xopenmp=parallel* and set some
environment variables as described here: