eb12b488   
   From: francis.glassborow@btinternet.com   
      
   On 05/02/2012 08:27, Roman W wrote:   
   > On Saturday, February 4, 2012 7:31:58 PM UTC, Edward Rosten wrote:   
   >> On Feb 4, 12:43 am, Roman W wrote:   
   >>   
      
   >> Well, yes. That was in the past, when C99 didn't exist in any   
   >> meaningful manner (the article was about C and C++). These days, C   
   >> solves the problem just fine within the standard. C++ solves it with   
   >> some common, nonstandard extensions.   
   >   
   > C99 offers dynamically sized arrays on the stack. This is not so great   
   > if you need a big array (stack storage is a rare commodity).   
   >   
   >>   
   >>> It's like saying that you can do OOP in C, and all C++ gives you is some   
   >>> syntactic sugar and compile time checking. Technically true, but misses   
   >>> the point completely.   
   >>   
   >> The point of the article was that was that certain optimizations are   
   >> impossible in C and C++. C specifically introduced a feature to make   
   >> such optimizations possible over 10 years ago.   
   >   
   > As I said above, as long as it is limited to stack storage, it cannot be   
   > used safely in a program which needs to handle large amounts of data.   
      
   That is not an inherent problem with C++, just with some of the most   
   common implementations. There is no reason that a stack should not be as   
   large as the addressing system (as implemented by the implementations   
   pointers) can support. Using 64-bit pointers allows a pretty large   
   address space (and paging deals with systems that have limited RAM --   
   note that C++ along with most computer languages, has no idea how   
   storage is provided.)   
      
   I am sure that were C99 being used extensively in domain areas that   
   benefit from large (multi-megabyte, or even multi-gigabyte) dynamic   
   arrays implementers would find ways to provide suitably large stacks   
   (note that neither C nor C++ actually require a stack. Stack frames do   
   not have to reside on a stack, and some implementations do not use a   
   stack for them)   
      
      
      
   --   
    [ See http://www.gotw.ca/resources/clcm.htm for info about ]   
    [ comp.lang.c++.moderated. First time posters: Do this! ]   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|