Re: How to optimize for win ce developlemnet

From: Paul G. Tobey [eMVP] (ptobey_no_spam_at_instrument_no_spam.com)
Date: 02/03/04


Date: Tue, 3 Feb 2004 12:33:13 -0700

There's not really any way to avoid that type of thing. More often than
not, in C, you *meant* to do that kind of thing. You might declare a
structure something like this:

typedef
struct
{
    int count
    long list[ 1 ];
} x;

Where your intent is to use count as the number of items in the list, rather
than somehow limiting the list to one element, as it's declared. C assumes
that you know what you're doing and mean to do what you say.

If you want some kind of checked access array, you can build one using C++,
by overloading the [] operator and checking some kind of length field before
allowing the operation...

Paul T.

"Jim" <jimy_mystry@rediffmail.com> wrote in message
news:%23uSfwDh6DHA.1368@TK2MSFTNGP10.phx.gbl...
> Thanks paul for your advice. But my Question is specific to a problem. I
was
> testing one of the interface on emnulator and it was working ok there but
> once i loaded the image onto the target device the screen start
disapearing.
> Something like i'm trying to open a window thru menu item and the desired
> screen was opening up. The reason there was probably a variable whose size
> was comparatively bigger in declartion. So how to avoid such conditions?
>
> "Paul G. Tobey [eMVP]" <ptobey_no_spam@instrument_no_spam.com> wrote in
> message news:#mXs$fa6DHA.2692@TK2MSFTNGP09.phx.gbl...
> > Well, there are not going to be any hard-and-fast rules, other than
> > 'maximums'. Don't try to allocate MB and MB of RAM all at one time, as
> your
> > process is limited to a maximum of 32MB (and the device might only have
> that
> > much, limiting you further).
> >
> > Performance should be optimized when you find problems. There's no use
> > globally optimizing your code, at the cost of many weeks or months,
unless
> > the first pass is not fast enough. If it turns out to be too slow, you
> can
> > concentrate on the part that is slow, rather than trying to optimize
> > everything...
> >
> > Paul T.
> >
> > "Jim" <jimy_mystry@rediffmail.com> wrote in message
> > news:u2GxhnX6DHA.1752@tk2msftngp13.phx.gbl...
> > > Hi guys,
> > >
> > > Can someone suggest me the best way of optimizing my code and memory
> usage
> > > while iam developing and application for wince.net based hand held
> > devices?
> > >
> > > What all i need to keep in mind for the same.
> > >
> > > -Jim
> > >
> > >
> >
> >
>
>



Relevant Pages

  • Re: 2.6.26-rc4: RIP __call_for_each_cic+0x20/0x50
    ... This helps in sense that 3 times bulk cross-compiles finish to the end. ... Paul, would you mind taking a quick look at cfq ... exists to avoid a double rcu_read_lock. ... static void cfq_slab_kill ...
    (Linux-Kernel)
  • Re: CPtrList with CSocket
    ... This means you don't need to declare ... Generally, you should avoid the ancient and, frankly, poorly-done, classes like CPtrList, ... By using two iteration mechanisms, one of which is inherently unrelated to the structure ... MVP Tips: http://www.flounder.com/mvp_tips.htm ...
    (microsoft.public.vc.mfc)
  • Re: MBF to IEEE (Beg. Q)
    ... I'm only trying to wrap my mind around what is going on with ... you use a Declare to avoid the typelib. ...
    (microsoft.public.vb.general.discussion)
  • Re: Artifact bitfield full? Or can I use the high bits?
    ... then don't use the sign bits just out of convervatism. ... avoid the sign bit of each byte. ... and declare the type unsigned (and never ... be compatible with some external format ...
    (rec.games.roguelike.nethack)
  • Re: Insurers warn on car alterations .
    ... lifestyles to avoid these hassles and expenses. ... Probably since car insurance has existed. ... Similarly, I have just renewed some building insurance, which required me to declare any modifications that might affect the level of risk insured. ...
    (uk.transport)

Loading