Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > Re: Wikipedia goes wrong: is this possible?

Reply
Thread Tools

Re: Wikipedia goes wrong: is this possible?

 
 
Andrew Smallshaw
Guest
Posts: n/a
 
      06-17-2013
On 2013-06-13, Stephen Sprunk <(E-Mail Removed)> wrote:
>
> With VLAs, the compiler automatically cleans up the memory when the
> object goes out of scope, so a memory leak is not possible. There is no
> need to rely on the programmer being perfect.


Brush up on the distinction between scope and extent. The array
may well go out of scope (indeed, it probably will for any non-trivial
function) but continue to exist before it comes back into scope.
Call another function inside that function and it is out of scope
within the callee, but it comes back again when control returns to
the caller.

--
Andrew Smallshaw
http://www.velocityreviews.com/forums/(E-Mail Removed)
 
Reply With Quote
 
 
 
 
Andrew Smallshaw
Guest
Posts: n/a
 
      06-17-2013
On 2013-06-15, paskali <(E-Mail Removed)> wrote:
>
> No, there are a lot of 32bit devices, as well as i wrote there are not
> economical reasons to choice 8bit devices in the place of more modern 32bit's.


Cite me one 32-bitter with a unit cost under 10 cents...

--
Andrew Smallshaw
(E-Mail Removed)
 
Reply With Quote
 
 
 
 
Ivan Shmakov
Guest
Posts: n/a
 
      06-17-2013
>>>>> paskali <(E-Mail Removed)> writes:
>>>>> Andrew Smallshaw <(E-Mail Removed)> wrote:
>>>>> On 2013-06-15, paskali <(E-Mail Removed)> wrote:


[Cross-posting to news:comp.arch.embedded, as ISTR that the
issue was already discussed there.]

>>> No, there are a lot of 32bit devices, as well as I wrote there are
>>> no economical reasons to choice 8bit devices in the place of more
>>> modern 32bit's.


>> Cite me one 32-bitter with a unit cost under 10 cents...


> Euros or Dollars?


I guess either 0.10 USD or 0.10 EUR would make quite an example.

FWIW, the MCUs I've dealt with are mostly in the 0.8 USD to some
2 USD range per piece, whether they're 8- or 32-bit. I believe
I've never bought an MCU for less than 0.5 USD a piece. But
then, I've never bought more than a dozen of a kind at any
single deal, which probably explains the difference.

--
FSF associate member #7257
 
Reply With Quote
 
Keith Thompson
Guest
Posts: n/a
 
      06-17-2013
Andrew Smallshaw <(E-Mail Removed)> writes:
> On 2013-06-13, Stephen Sprunk <(E-Mail Removed)> wrote:
>> With VLAs, the compiler automatically cleans up the memory when the
>> object goes out of scope, so a memory leak is not possible. There is no
>> need to rely on the programmer being perfect.

>
> Brush up on the distinction between scope and extent. The array
> may well go out of scope (indeed, it probably will for any non-trivial
> function) but continue to exist before it comes back into scope.
> Call another function inside that function and it is out of scope
> within the callee, but it comes back again when control returns to
> the caller.


What you're calling "extent" is what the Standard calls "storage
duration" or "lifetime". An object's storage duration is either
static, thread, automatic, or allocated ("thread" was added by C11).
It's *lifetime* is "the portion of program execution during which
storage is guaranteed to be reserved for it" (C11 6.2.4p2).

The term *scope*, on the other hand, applies to an identifier.
Quoting the standard again (6.2.1p2):

For each different entity that an identifier designates, the
identifier is *visible* (i.e., can be used) only within a region
of program text called its *scope*.

Note that *scope* is a region of program text, while *lifetime*
is a subset of the time during which the program is executing.
It doesn't necessarily make sense to talk about an object (actually
the identifier that names the object) going in an out of scope
during program execution -- though I suppose you could relate it
to the chunk of code that's executing at a given moment.

--
Keith Thompson (The_Other_Keith) (E-Mail Removed) <http://www.ghoti.net/~kst>
Working, but not speaking, for JetHead Development, Inc.
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
 
Reply With Quote
 
Keith Thompson
Guest
Posts: n/a
 
      06-17-2013
Keith Thompson <(E-Mail Removed)> writes:
[...]
> What you're calling "extent" is what the Standard calls "storage
> duration" or "lifetime". An object's storage duration is either
> static, thread, automatic, or allocated ("thread" was added by C11).
> It's *lifetime* is "the portion of program execution during which
> storage is guaranteed to be reserved for it" (C11 6.2.4p2).


s/It's/Its/ (d'oh!)

--
Keith Thompson (The_Other_Keith) (E-Mail Removed) <http://www.ghoti.net/~kst>
Working, but not speaking, for JetHead Development, Inc.
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
 
Reply With Quote
 
Jukka Marin
Guest
Posts: n/a
 
      06-17-2013
On 2013-06-17, Ivan Shmakov <(E-Mail Removed)> wrote:
> FWIW, the MCUs I've dealt with are mostly in the 0.8 USD to some
> 2 USD range per piece, whether they're 8- or 32-bit. I believe
> I've never bought an MCU for less than 0.5 USD a piece. But
> then, I've never bought more than a dozen of a kind at any
> single deal, which probably explains the difference.


The NXP LPC8xx series is expected to be in the 50 cent range (and up).
Not bad for a 32-bit RISC in DIP8... (Yes, they do have DIP8.)

-jm
 
Reply With Quote
 
Uwe Bonnes
Guest
Posts: n/a
 
      06-17-2013
In comp.arch.embedded Jukka Marin <(E-Mail Removed)> wrote:
> On 2013-06-17, Ivan Shmakov <(E-Mail Removed)> wrote:
> > FWIW, the MCUs I've dealt with are mostly in the 0.8 USD to some
> > 2 USD range per piece, whether they're 8- or 32-bit. I believe
> > I've never bought an MCU for less than 0.5 USD a piece. But
> > then, I've never bought more than a dozen of a kind at any
> > single deal, which probably explains the difference.


> The NXP LPC8xx series is expected to be in the 50 cent range (and up).
> Not bad for a 32-bit RISC in DIP8... (Yes, they do have DIP8.)


"Expected"? Argh!

A price you can't see for parts avaiable at mouser or digikey is not real...
--
Uwe Bonnes http://www.velocityreviews.com/forums/(E-Mail Removed)-darmstadt.de

Institut fuer Kernphysik Schlossgartenstrasse 9 64289 Darmstadt
--------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------
 
Reply With Quote
 
Mark Borgerson
Guest
Posts: n/a
 
      06-18-2013
In article <kpo0gf$i84$(E-Mail Removed)-darmstadt.de>,
(E-Mail Removed)-darmstadt.de says...
>
> In comp.arch.embedded Jukka Marin <(E-Mail Removed)> wrote:
> > On 2013-06-17, Ivan Shmakov <(E-Mail Removed)> wrote:
> > > FWIW, the MCUs I've dealt with are mostly in the 0.8 USD to some
> > > 2 USD range per piece, whether they're 8- or 32-bit. I believe
> > > I've never bought an MCU for less than 0.5 USD a piece. But
> > > then, I've never bought more than a dozen of a kind at any
> > > single deal, which probably explains the difference.

>
> > The NXP LPC8xx series is expected to be in the 50 cent range (and up).
> > Not bad for a 32-bit RISC in DIP8... (Yes, they do have DIP8.)

>
> "Expected"? Argh!
>
> A price you can't see for parts avaiable at mouser or digikey is not real...


That's been my criteria for designing in parts for more than a decade.
If you can't find it at one of those two, it really isn't something I
want to put in a design. Those companies have become a my proxy
of choice for a good purchasing agent when I am looking for quantities
under 100 of almost anything. Granted, that I may pay a bit more per
part---but that's nothing in comparison to designing in a part I can't
find in time to deliver my product.

Mark Borgerson
 
Reply With Quote
 
Jukka Marin
Guest
Posts: n/a
 
      06-18-2013
On 2013-06-17, Uwe Bonnes <(E-Mail Removed)-darmstadt.de> wrote:
>> The NXP LPC8xx series is expected to be in the 50 cent range (and up).
>> Not bad for a 32-bit RISC in DIP8... (Yes, they do have DIP8.)

>
> "Expected"? Argh!


Arrow says the price is 0.39 eur (@ 10000 pcs). Haven't actually
tried to buy any. Got a demo board from NXP recently, so the chip does
exist. Digi-Key knows the part numbers, but has 0 stock.

-jm
 
Reply With Quote
 
Oliver Betz
Guest
Posts: n/a
 
      06-18-2013
Jukka Marin wrote:

>On 2013-06-17, Ivan Shmakov <(E-Mail Removed)> wrote:
>> FWIW, the MCUs I've dealt with are mostly in the 0.8 USD to some
>> 2 USD range per piece, whether they're 8- or 32-bit. I believe
>> I've never bought an MCU for less than 0.5 USD a piece. But
>> then, I've never bought more than a dozen of a kind at any
>> single deal, which probably explains the difference.

>
>The NXP LPC8xx series is expected to be in the 50 cent range (and up).
>Not bad for a 32-bit RISC in DIP8... (Yes, they do have DIP8.)


Infineon XMC1000 might be in the same range and has really powerful
peripherals. Kinetis KL0 is also cheap.

Oliver
--
Oliver Betz, Munich
despammed.com is broken, use Reply-To:
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Wikipedia goes wrong: is this possible? Eric Sosman C Programming 10 06-19-2013 01:21 PM
Re: Wikipedia goes wrong: is this possible? Stephen Sprunk C Programming 9 06-18-2013 02:20 PM
Re: Wikipedia goes wrong: is this possible? Siri Cruise C Programming 4 06-15-2013 02:31 AM
Re: Wikipedia goes wrong: is this possible? Noob C Programming 0 06-13-2013 01:36 PM
Really throwing this out there - does anyone have a copy of my oldDancer web browser? steven.miale@gmail.com Python 1 04-10-2013 03:32 PM



Advertisments