Err, I missed calculated the first time I looked at it... (got 4096 the
second time :)

So then I would do something like:

#define MAXCODELEN 12
#define MAXCODE (1 << MAXCODELEN)

typedef struct {
    int previous, val, next, bro;
} CEntry;

typedef struct {
    CEntry *codes;
    int ncodes, codeLen, datLen;
    int clear, end;
} codeTable_;

extern codeTable_ codeTable;

codeTable.codes = (CEntry *)MemPtrNew(MAXCODE);

Mostly, I believe that codeTable.codes is some sort of array. This is code I
am fixing from a utility that converts gif to pbmp on PC side so that it
does this on the Palm.

Thanks,
Donald


"Douglas Handy" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Donald,
>
>
> >The problem seemed to come from "#define MAXCODE (1 << MAXCODELEN) ".
> >Although, that does not seem to be as large as I initially thought?
>
> MAXCODE would be 4096 by my reckoning, so you'd have 32K consumed by just
the
> codes array within codeTable_ since each CEntry needs 8 bytes to hold the
4
> integers.  You should just dynamically allocate the 32K at runtime using
> MemPtrNew (or MemHandleNew) then change all references to codeTable_ to
> reference that pointer.
>
> Doug
>



-- 
For information on using the PalmSource Developer Forums, or to unsubscribe, 
please see http://www.palmos.com/dev/support/forums/

Reply via email to