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 pena
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
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 more
Thanks for the work!
I will try the Solaris builds once I get back to the office on Monday.
Regards,
Elias
On 5 April 2014 21:26, Juergen Sauermann wrote:
> Hi,
>
> I hope the Solaris issues are fixed now (SVN 187). Please complain if not.
>
> I decided against alloca() because the descriptio
I read that description too, but they never clarify what those problems may
be. The only thing I can think of is the risk of blowing the stack if the
block is too large, but that is not different from using dynamically
allocated arrays in C like you used to.
Regards,
Elias
On 5 April 2014 21:26,
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. A
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:
http://
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 wrote:
> On 2 April 2014 18:32, Elias Mårtenson wrote:
>
> Declaring an array with a size computed at runtime is not actually allowed
>> (it's supported
On 2 April 2014 18:32, Elias Mårtenson 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,
Elias
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 a
10 matches
Mail list logo