Re: MemHandleNew, MemPtrNew

2009-03-26 Thread Guilherme Campos Hazan
Actually, using GCC, you can use globals anywhere. In our product, TotalCross (www.totalcross.com), you can use ARM native threads with globals support, and works fine on all palm os arm devices. The idea is tell GCC to use a register for globals (e.g.: r10), then in the main program you save

Re: MemHandleNew, MemPtrNew

2009-03-11 Thread Darren
The problem is resolved when the allocation is moved to the start of dekmain(), the globals are accessed through a pointer to one instance of the typedef'd struct, which is declared at the start of deskmain(), and assigned to a locked chunk until the end of deskmain(). desk accessories 'DAcc'

Re: MemHandleNew, MemPtrNew

2009-03-11 Thread Darren
apologies, there is a declaration after the Err err; psuedo_globals *GLB; also the problem is now resolved : have now managed to allocate and free a malloc using MemPtrNew() and MemPtrFree(), by moving the allocation code to just after the global struct is declared, instead of just before

Re: MemHandleNew, MemPtrNew

2009-03-10 Thread Jeff Loucks
, Mar 10, 2009 at 12:12 PM, Jeff Loucks wrote: > What Dmitry is so eloquently saying is that MemPtrNew() and > MemHandleNew() allocates from dynamic heap, which is volatile RAM. The NAND > is a type of flash reprogrammable ROM. The flash ROM is where your databases > records and reso

Re: MemHandleNew, MemPtrNew

2009-03-10 Thread Jeff Loucks
What Dmitry is so eloquently saying is that MemPtrNew() and MemHandleNew() allocates from dynamic heap, which is volatile RAM. The NAND is a type of flash reprogrammable ROM. The flash ROM is where your databases records and resources end up, after spending some time in an intermediate cache in

Re: MemHandleNew, MemPtrNew

2009-03-10 Thread Dmitry Grinberg
GRANULARITY OF THE NAND? FOR THE LAST TIME: YOU ARE not ALLOCATING MEMORY IN THE NAND FLASH! YOU ARE NOT ALLOCATING MEMORY IN THE NAND FLASH! YOU ARE NOT ALLOCATION MEMORY IN THE NAND FLASH! am i getting through? Best Regards, Dmitry Grinberg (847) 226 9295 On Tue, Mar 10, 2009

Re: MemHandleNew, MemPtrNew

2009-03-10 Thread Darren
: // //start Int8 start(void){Deskmain(); return 0x00; // •• // InitGlobals psuedo_globals* InitGlobals(void) {return(MemPtrNew(sizeof(psuedo_globals)));} // •• // Deskmain void Deskmain(void) { // check

Re: MemHandleNew, MemPtrNew

2009-03-09 Thread Jeff Loucks
> Dmitry Grinberg > (847) 226 9295 > > > > On Mon, Mar 9, 2009 at 2:42 AM, Darren Barnes > wrote: > > > > You are using both MemHandleNew and MemPtrNew to allocate 1 chuck ?? > > Use one or the other, not both. > > > > in reply : > >

Re: MemHandleNew, MemPtrNew

2009-03-09 Thread Dmitry Grinberg
There is NO special procedure Did you read my last post - it 100% answered why you have problems... Best Regards, Dmitry Grinberg (847) 226 9295 On Mon, Mar 9, 2009 at 2:42 AM, Darren Barnes wrote: > > You are using both MemHandleNew and MemPtrNew to allocate 1 chuck ?? > Use o

Re: MemHandleNew, MemPtrNew

2009-03-09 Thread Darren Barnes
You are using both MemHandleNew and MemPtrNew to allocate 1 chuck ?? Use one or the other, not both. in reply :the three function pairs that are having problems are MemHandleNew/MeHandleFree,MemPtrNew/MemPtrFree and FtrPtrNew/FtrPtrFree.The malloc is for a list during the lifetime of the

Re: MemHandleNew, MemPtrNew

2009-03-06 Thread Regis St-Gelais
"Darren" a écrit dans le message de news: 187...@palm-dev-forum... > Hello, > am trying to allocate a simple small chunk (2048 bytes)on the dynamic heap > using these two calls. You are using both MemHandleNew and MemPtrNew to allocate 1 chuck ?? Use one or the other, not

Re: MemHandleNew, MemPtrNew

2009-03-06 Thread Dmitry Grinberg
the fact that free causes crashes imply you wrote outside the area you allocated. fix that Best Regards, Dmitry Grinberg (847) 226 9295 On Fri, Mar 6, 2009 at 6:29 AM, Darren wrote: > Hello, > am trying to allocate a simple small chunk (2048 bytes)on the dynamic heap > using these two cal

Re: MemHandleNew, MemPtrNew

2009-03-06 Thread Michal Seliga
make sure you don't try to free same chunk more then once storage memory or dbcache have no effect on MemPtrNew and MemHandleNew, so nand is definitely no problem i think you should check if all allocations were succesfull, maybe application which is running is eating so much memory that

Re: MemHandleNew, MemPtrNew

2009-03-06 Thread Ryan Rix
Hi, Chances are the app that you are launching your desk accessory on is eating up most of the stack. ~Ryan On Fri, Mar 6, 2009 at 7:29 AM, Darren wrote: > Hello, > am trying to allocate a simple small chunk (2048 bytes)on the dynamic heap > using these two calls. > The application is a 'DAcc'

MemHandleNew, MemPtrNew

2009-03-06 Thread Darren
Hello, am trying to allocate a simple small chunk (2048 bytes)on the dynamic heap using these two calls. The application is a 'DAcc' desk accessory, primarily for use on a TX (NAND?) and a TG50. Keeps resetting sometimes when the desk accessory is initially invoked, sometimes when the desk

Re: MemPtrNew fragmentation

2008-07-03 Thread John Gruenenfelder
On Tue, Jul 01, 2008 at 01:51:50PM +0200, Michal Seliga wrote: > John Gruenenfelder wrote: >> >> Unfortunately, at 308 bytes per item, the index is limited to ~210 total >> items >> before the 64K allocation limit is reached. >> > > forget about limit, you can use MemGluePtrNew from glue library w

Re: MemPtrNew fragmentation

2008-07-01 Thread Lionscribe
Well this calls for the good old fashioned method of seperate records for each index. The cost of 16-18 bytes per record will pale in comparison to the 100+ bytes saved per record. You can then use all the Dm* functions for sorting and etc. Lionscribe -- For information on using the ACCESS Dev

Re: MemPtrNew fragmentation

2008-07-01 Thread Michal Seliga
John Gruenenfelder wrote: Unfortunately, at 308 bytes per item, the index is limited to ~210 total items before the 64K allocation limit is reached. forget about limit, you can use MemGluePtrNew from glue library with which you can allocate more then 64kb in one block and it works from palmo

MemPtrNew fragmentation

2008-06-30 Thread John Gruenenfelder
Hello, In my app I create an index of books/PDBs installed on the device. The structure I use is 308 bytes in size with nearly all of that devoted to the VFS filename (255 bytes). My program allocates very few small chunks of memory. Rather, I allocate larger arrays and grow them if necessary.

Do I need to do a MemPtrNew in C++?

2008-05-29 Thread Tjeng-Bo Lie
Do I need to do a MemPtrNew or MemHandleNew when instantiating a new object in C++? -- For information on using the ACCESS Developer Forums, or to unsubscribe, please see http://www.access-company.com/developers/forums/

Re: func returning memptrnew

2008-05-29 Thread Richard Hartman
,.. > >char* getString(void) { >char* returnString; >returnString=MemPtrNew(50); >StrCopy(returnString, "heya"); >return returnString >} > >that returns a ptr to this string, do i have to call memPtrFree to free it >in its parent? or does the

Re: What is max size we can allocate using MemPtrNew()

2008-05-28 Thread chongwm
For titanic allocations, I use MemHeapFreeBytes() first. Deepak D wrote: > > Hi All, > > What is max size we can allocate using MemPtrNew(). > If I tried allocate more 32kBytes it fails to > allocate. > > Tha

Re: What is max size we can allocate using MemPtrNew()

2008-05-28 Thread Ron Nicholson
Deepak D writes: What is max size we can allocate using MemPtrNew(). If I tried allocate more 32kBytes it fails to allocate. Note that the maximum chunk you can allocate varies with the Palm model, OS version and amount of RAM memory. On some older units you can't even get 32k, only a

RE: about MemPtrNew

2006-02-06 Thread esily
yes,it's clear,now,i know,thanks. -- For information on using the PalmSource Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/

RE: about MemPtrNew

2006-02-06 Thread Grzegorz Szewc
Here is detailed example: //here is allocation for original data MemPtr dateP = MemPtrNew(20*sizeof(dateType)); //Lets do sth. with orginal data... ///... //done //Now we will copy data stored in memory from dataP pointer to newPtr. // MemPtrSize will return 20* sizeof(dateType) Int16 size

RE: about MemPtrNew

2006-02-06 Thread esily
i am sorry, i can't understand ,could you write angain in more detail? -- For information on using the PalmSource Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/

RE: about MemPtrNew

2006-02-06 Thread Grzegorz Szewc
); UInt16 num = MemPtrSize (dateP); dateType *newP = MemPtrNew (num); MemMove(newP,dataP,num); Regards, Gregory -- For information on using the PalmSource Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/

about MemPtrNew

2006-02-05 Thread esily
I want to move some date from a chunk to another,but there is some question puzzled me; ... if (dateP) { UInt16 size = sizeof (dateType); UInt16 num = MemPtrSize (dateP); dateType *newP = MemPtrNew (num*size); if (newP) { UInt16 j = 0; for (UInt16 i = 0; i < num; i++) { if (dateP[i].refr

Re: FrmDoDialog, MemPtrNew and Heap Corruption?

2005-07-22 Thread Henk Jonas
The memory seems already trashed before MemPtrNew is called. Have a deep look into your code, examine pointers, initialize them with NULL, check return values and you will sooner or later find the place where you write something on a random place. Regards Henk Adam Ernst wrote: I'm tryi

FrmDoDialog, MemPtrNew and Heap Corruption?

2005-07-20 Thread Adam Ernst
I'm trying to track down some nasty heap corruption. When I run my app in POSE, I get an error stating that some function is writing out of the allocated memory bounds. No problem--drop into gdb, print the stack trace. To my surprise, it is MemPtrNew that are writing out of b

Re: can you create a MemPtrNew outside of a function?

2004-10-25 Thread Tim Kostka
Bad news: MemPtrNew is a function and so you can't call it outside of a segment of code. Good news: Once you call it, you can access the memory pointer anywhere inside your code until you free it using MemPtrFree. What you may want to do is if you're in need of a large (or semi-lar

Re: can you create a MemPtrNew outside of a function?

2004-10-23 Thread chad downey
Thanks for the quick reply. No I was under the impression that If I declared it outside It would be global and I could let any of my functions use it. Would that be true? I am a modest programmer and my program is working good I have gotten almost everything else together. Now all I need to do i

Re: can you create a MemPtrNew outside of a function?

2004-10-23 Thread Ben Combee
At 09:30 PM 10/23/2004, you wrote: #define MySizeVari 34 #define myStr Char* myStr = (Char*) MemPtrNew(MySizeVari); // allocate a 13-byte pointer //StrCopy(myStr, "Hello World!"); // use it MemPtrFree(myStr); why dosent this work I have changed all kinds of stuff around read t

can you create a MemPtrNew outside of a function?

2004-10-23 Thread chad downey
#define MySizeVari 34 #define myStr Char* myStr = (Char*) MemPtrNew(MySizeVari); // allocate a 13-byte pointer //StrCopy(myStr, "Hello World!"); // use it MemPtrFree(myStr); why dosent this work I have changed all kinds of stuff around read the api's 7 ways

Re: Maximum number of calls to MemPtrNew?

2004-06-20 Thread Cory Pratt
I stand corrected. Thanks again. Time to go re-read that section on memory. ;-) -Cory Ben Combee wrote: > At 07:53 AM 6/20/2004, you wrote: >>Thanks for the info Ben. I guess that explains why local chunk ID's are >>only UInt16's. > > Actually, that's not true. A HeapID is a UInt16, as there

Re: Maximum number of calls to MemPtrNew?

2004-06-20 Thread Ben Combee
At 07:53 AM 6/20/2004, you wrote: Thanks for the info Ben. I guess that explains why local chunk ID's are only UInt16's. Actually, that's not true. A HeapID is a UInt16, as there can't be more than 64K different heaps in Palm OS, but a LocalID, which identifies a chunk on a heap, is a UInt32.

Re: Maximum number of calls to MemPtrNew?

2004-06-20 Thread Cory Pratt
Thanks for the info Ben. I guess that explains why local chunk ID's are only UInt16's. -Cory Ben Combee wrote: > At 08:41 PM 6/17/2004, you wrote: >>Is there a limit to the number of times an application can call MemPtrNew? >>I have a program that always fails to a

Re: Maximum number of calls to MemPtrNew?

2004-06-17 Thread Ben Combee
At 08:41 PM 6/17/2004, you wrote: Is there a limit to the number of times an application can call MemPtrNew? I have a program that always fails to allocate memory after 2779 objects (and their child objects) have been created regardless of how much memory I assign in POSE. Is there a limit in the

Maximum number of calls to MemPtrNew?

2004-06-17 Thread Cory Pratt
Is there a limit to the number of times an application can call MemPtrNew? I have a program that always fails to allocate memory after 2779 objects (and their child objects) have been created regardless of how much memory I assign in POSE. Is there a limit in the OS memory manager as to how many

Re: MemPtrNew, MemHandleNew and anything about MemXXX

2004-06-08 Thread Ben Combee
At 10:02 PM 6/8/2004, you wrote: Hello XPerts, I have problem with dynamic allocation memory in palm. Please help. 1. How do i convert array of pointers from using 'New' to 'MemGluePtrNew'/'MemPtrNew'? Define your own operator new (using inline) that c

MemPtrNew, MemHandleNew and anything about MemXXX

2004-06-08 Thread \[ a | x \] - Peter Alex
Hello XPerts, I have problem with dynamic allocation memory in palm. Please help. 1. How do i convert array of pointers from using 'New' to 'MemGluePtrNew'/'MemPtrNew'? 2. How to dispose dynamic array claimed by MemPtrNew/MemGluePtrNew? So far I used MemPtrFree

RES: MemPtrNew versus MemHandleNew

2004-06-08 Thread Desenvolvimento 3
to let the PalmOS manager the memory freely...When you see that you won´t use this handle anymore you free it with memhandlefree. The MemPtrNew simple allocates memory, the PalmOS will "forget" that chuncks for this while (up to MemPtrFree) because it is yours! So, you have to feel the b

Re: MemPtrNew versus MemHandleNew

2004-06-08 Thread Robert Scott
On Tue, 8 Jun 2004 17:16:10 -0300, "Régis Daniel de Oliveira" <[EMAIL PROTECTED]> wrote: >Hy all! > > >My app need to allocate four 4k buffer, that will be used by many functions >during the app execution. I can allocate memory for the pointers using >MemPtrNew

MemPtrNew versus MemHandleNew

2004-06-08 Thread Régis Daniel de Oliveira
Hy all! My app need to allocate four 4k buffer, that will be used by many functions during the app execution. I can allocate memory for the pointers using MemPtrNew and MemHandleNew. Witch one is the best for using? Thanls all! -- For information on using the Palm Developer Forums, or to

RE: MemPtrNew / MemPtrFree question

2004-04-23 Thread Hays, Jonathan \(GE Infrastructure\)
Sent: Friday, April 23, 2004 3:55 AM To: Palm Developer Forum Subject: Re: MemPtrNew / MemPtrFree question Hi, does this also apply the the same way to MemHandles? Thanks Peter "Hays, Jonathan (GE Infrastructure)" <[EMAIL PROTECTED]> schrieb im Newsbeitrag news:[EMAIL PROTECTED] You

Re: MemPtrNew / MemPtrFree question

2004-04-23 Thread Dave Lippincott
: Friday, April 23, 2004 6:54 AM Subject: Re: MemPtrNew / MemPtrFree question > Hi, > does this also apply the the same way to MemHandles? > > Thanks > Peter > > "Hays, Jonathan (GE Infrastructure)" <[EMAIL PROTECTED]> schrieb im > Newsbeitrag news:[EMAIL PRO

Re: MemPtrNew / MemPtrFree question

2004-04-23 Thread Pit
er Forum Subject: MemPtrNew / MemPtrFree question Hi, i m using MemPtrNew like in the following pseudo code: char** temp; temp = MemPtrNew (size * sizeof (char*)) for ( int i = 0; i < size; i++) { temp[i] = MemPtrNew (10); } Do i have to free it like the same way, or is a call of MemPtrFree(te

RE: MemPtrNew / MemPtrFree question

2004-04-22 Thread Hays, Jonathan \(GE Infrastructure\)
PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Pit Sent: Thursday, April 22, 2004 1:32 PM To: Palm Developer Forum Subject: MemPtrNew / MemPtrFree question Hi, i m using MemPtrNew like in the following pseudo code: char** temp; temp = MemPtrNew (size * sizeof (char*)) for ( int i = 0; i < size

MemPtrNew / MemPtrFree question

2004-04-22 Thread Pit
Hi, i m using MemPtrNew like in the following pseudo code: char** temp; temp = MemPtrNew (size * sizeof (char*)) for ( int i = 0; i < size; i++) { temp[i] = MemPtrNew (10); } Do i have to free it like the same way, or is a call of MemPtrFree(temp) enough? So does MemPtrFree(temp), also f

Re: MemPtrNew / MemPtrFree

2004-02-17 Thread Flex
put this somewhere out of the function (make it global) and declare it as external to have acces to it from everywhere: ContextType *context; Then in you AppStart function add this: context=(ContextType *)MemPtrNew(sizeof(ContextType)); in AppStop add: MemPtrFree(context); George wrote: Hello

Re: MemPtrNew / MemPtrFree

2004-02-17 Thread Ryan Andersen
George, How HUGE is your global structure? You should never create nor reference globals from within the PalmMain function. You should also keep your use of globals to a minimum. But any globals you do use in your app can be created/initialized in your AppStart() function. MemPtrNew allocates

MemPtrNew / MemPtrFree

2004-02-17 Thread George
Hello, Since I'm a Palm OS newbie, I need some help. I'm debugging an applicaiton using the Emulator and found out that the application sometimes gets "memory leaks" error. Ben Combee also suggested that I should use "MemPtrNew" to decrease my stack size in my prev

Re: Allocating memory for Char strings - MemPtrNew(StrLen(charsP))?

2003-10-01 Thread Mathew Parker
object lists. I > > implemented long (dynamic) strings the same way. > > > > Use MemHandleNew and MemHandleFree instead of MemPtrNew and MemPtrFree. > > When you need to resize the piece of memory, call MemHandleResize. > > This advice will do absolutely nothing to solve

Re: Allocating memory for Char strings - MemPtrNew(StrLen(charsP))?

2003-10-01 Thread Dave Carrigan
On Wed, Oct 01, 2003 at 03:02:30PM -0400, Mathew Parker wrote: > I ran into similar problems when creating dynamic object lists. I > implemented long (dynamic) strings the same way. > > Use MemHandleNew and MemHandleFree instead of MemPtrNew and MemPtrFree. > When you need to resi

Re: Allocating memory for Char strings - MemPtrNew(StrLen(charsP))?

2003-10-01 Thread Mathew Parker
Kerry, I ran into similar problems when creating dynamic object lists. I implemented long (dynamic) strings the same way. Use MemHandleNew and MemHandleFree instead of MemPtrNew and MemPtrFree. When you need to resize the piece of memory, call MemHandleResize. The only real difference is you

Re: Allocating memory for Char strings - MemPtrNew(StrLen(charsP))?

2003-10-01 Thread Dave Carrigan
On Wed, Oct 01, 2003 at 10:27:06AM -0700, Kerry Twibell wrote: > I've been using the function "MemPtrNew(StrLen(charsP)) - this way, I > don't allocate too much or too little memory. Is this the correct way > to allocate memory for Char strings? No. You need to find a g

RE: Allocating memory for Char strings - MemPtrNew(StrLen(charsP))?

2003-10-01 Thread Colin Mitchell
It would probably be good if you told us what problems you are having. but if charsP is a pre-existing string that you want to copy, you would need to do: MemPtrNew(sizeof(Char) * (StrLen(charsP) + 1)) The '+1' is for the null at the end of the string. Best, Colin -Origin

Allocating memory for Char strings - MemPtrNew(StrLen(charsP))?

2003-10-01 Thread Kerry Twibell
I'm having problems re: allocating memory for dynamic strings. My application does a lot of string parsing, and I don't know how large strings will be in advance. I've been using the function "MemPtrNew(StrLen(charsP)) - this way, I don't allocate too much or too l

Re: MemPtrNew for a class doesn't call the contructor

2003-09-22 Thread Ben Combee
At 01:17 AM 9/17/2003, Eric Potter wrote: On Tue, 16 Sep 2003 14:22:29 -0700, Dave Carrigan <[EMAIL PROTECTED]> wrote: > >On Tue, Sep 16, 2003 at 04:10:33PM -0500, Eric Potter wrote: >> When I try and use the new operator, I get a Link Error saying, " >> 'operator new(unsigned long)' referenced fro

Re: MemPtrNew for a class doesn't call the contructor

2003-09-22 Thread Ben Combee
At 07:56 PM 9/16/2003, Dave Carrigan wrote: On Tue, Sep 16, 2003 at 12:54:49PM -0500, Eric Potter wrote: > Is there a was to get MemPtrNew to call the contructor when you craete > a new class? Use the new operator; that's what it's for. Just to clarify -- the standard implementa

Re: MemPtrNew for a class doesn't call the contructor

2003-09-16 Thread Eric Potter
On Tue, 16 Sep 2003 14:22:29 -0700, Dave Carrigan <[EMAIL PROTECTED]> wrote: > >On Tue, Sep 16, 2003 at 04:10:33PM -0500, Eric Potter wrote: >> When I try and use the new operator, I get a Link Error saying, " >> 'operator new(unsigned long)' referenced from 'MyClass::MyFunc' is >> undefined." > >

Re: MemPtrNew for a class doesn't call the contructor

2003-09-16 Thread Dave Carrigan
On Tue, Sep 16, 2003 at 04:10:33PM -0500, Eric Potter wrote: > When I try and use the new operator, I get a Link Error saying, " > 'operator new(unsigned long)' referenced from 'MyClass::MyFunc' is > undefined." What compiler are you using, and if it's prc-tools, what does your linker command look

Re: MemPtrNew for a class doesn't call the contructor

2003-09-16 Thread Eric Potter
On Tue, 16 Sep 2003 10:56:35 -0700, Dave Carrigan <[EMAIL PROTECTED]> wrote: > >On Tue, Sep 16, 2003 at 12:54:49PM -0500, Eric Potter wrote: >> Is there a was to get MemPtrNew to call the contructor when you craete >> a new class? > >Use the new operator; that's

Re: MemPtrNew for a class doesn't call the contructor

2003-09-16 Thread Dave Carrigan
On Tue, Sep 16, 2003 at 12:54:49PM -0500, Eric Potter wrote: > Is there a was to get MemPtrNew to call the contructor when you craete > a new class? Use the new operator; that's what it's for. -- Dave Carrigan Seattle, WA, USA [EMAIL PROTECTED] | http://www.rudedog.org/ | IC

MemPtrNew for a class doesn't call the contructor

2003-09-16 Thread Eric Potter
Is there a was to get MemPtrNew to call the contructor when you craete a new class? -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/

Re: Bad alignment in MemPtrNew on emulator?

2003-02-14 Thread Keith Rollin
At 4:57 PM +0100 2/14/03, Jan Slodicka wrote: Hi I don't know if I am blind and don't see something, but following line FileReader *reader= (FileReader *)MemPtrNew( sizeof(FileReader ) ) ; produced the value 0x3AA52 on the emulator. As I am checking the result on 4-byte alignme

Re: Bad alignment in MemPtrNew on emulator?

2003-02-14 Thread Jan Slodicka
t alignment errors. > > Just an idea -- did you hook up a leak tracking system? (e.g. macro that > redirects MemPtrNew to something else that allocates a little extra space at > the beginning of the chunk for a debug header, such as next/prev pointers > for a linked list, then return

Re: Bad alignment in MemPtrNew on emulator?

2003-02-14 Thread Chris Antos
I haven't run into such a problem (and my code would blow up as well in that case). Just an idea -- did you hook up a leak tracking system? (e.g. macro that redirects MemPtrNew to something else that allocates a little extra space at the beginning of the chunk for a debug header, such as

Bad alignment in MemPtrNew on emulator?

2003-02-14 Thread Jan Slodicka
Hi I don't know if I am blind and don't see something, but following line FileReader *reader= (FileReader *)MemPtrNew( sizeof(FileReader ) ) ; produced the value 0x3AA52 on the emulator. As I am checking the result on 4-byte alignment (before passing to ARM), I could catch the bu

Re: MemPtrNew versus new

2003-02-12 Thread Ben Combee
At 14:46 2003-2-12 -0800, you wrote: I'm sure this has been mentioned before, but what is the preffered method to allocate memory (CW9)? In both CodeWarrior and prc-tools, new calls MemPtrNew to allocate memory. There should be no difference in actual allocations between these two me

Re: MemPtrNew versus new

2003-02-12 Thread Keith Rollin
code that comes with CodeWarrior (e.g., does malloc just call MemPtrNew, or does it allocate a large chunk and suballocate from it). But, actually, MemHandleNew is the preferred method to allocate memory. -- Keith Rollin -- Palm OS Emulator engineer -- For information on using the Palm Develo

MemPtrNew versus new

2003-02-12 Thread Bill Andreozzi
I'm sure this has been mentioned before, but what is the preffered method to allocate memory (CW9)? Does either one frament the heap any more than the other etc? thanks - bill -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/suppor

Re: Pls do help on MemPtrNew problem

2002-10-09 Thread Martin Elzen
quennie wrote: >decided to use an global variable, say n_text as passing parameter between >FormA and FormB. So, the n_text will be assigned a value from one of the >selectorTrigger(when the selectorTrigger was triggered) to FormB. Similarly >to the FormB, the n_text will be assigned a value to Fo

Re: Pls do help on MemPtrNew problem

2002-10-08 Thread quennie_keng
n M N cc: Subject: Re: Pls do help on MemPtrNew problem 10/09/2002

Pls do help on MemPtrNew problem

2002-10-08 Thread quennie_keng
t;m_data.phone2 = n_text; SetSelectorTriggerLabel(eventP->data.frmUpdate.updateCode, o_phone->m_data.phone1); FormB: void Text::save() { - - - FldPtr field = (FldPtr) GetObjectPtr(FieldA); Char *text = FldGetTextPtr (field); n_text= (Char*)MemPtrNew(StrLen(text)+1); StrC

Re: MemPtrNew problem

2002-10-08 Thread Henk Jonas
You have to allocate space for the pointer to char. You have declared the pointer to the pointer to char, now allocate first the space for the pointer to char (4 bytes) and initialize your pointer to pointer to char with it, then allocate space for the character array and initialize the pointe

Re: MemPtrNew problem

2002-10-08 Thread quennie_keng
re in the Text Class - - - FldPtr field = (FldPtr) GetObjectPtr(FieldA); Char *text = FldGetTextPtr (field); *title = (Char*)MemPtrNew(StrLen(text)+1); StrCopy(*title, text); } ButtonOk: o_text->SaveText(); FrmReturnToForm(0); - - - send event to update event class General: tyd

Re: MemPtrNew problem

2002-10-08 Thread Ben Combee
At 16:24 2002-10-8 +0800, you wrote: >Hi. > >I have encountered the Ptr problem where there is a pointer to char >pointer, I allocate a MemPtrNew to the pointer to do some manipulation. >After using it and would like to free it in the StopApplication, it give me >an error where

MemPtrNew problem

2002-10-08 Thread quennie_keng
Hi. I have encountered the Ptr problem where there is a pointer to char pointer, I allocate a MemPtrNew to the pointer to do some manipulation. After using it and would like to free it in the StopApplication, it give me an error where the pointer i free was an unallocated chunk. If i didn't

Re: Can't MemPtrNew inside MemHandleLock

2002-08-16 Thread Jason Freund
Ben Combee: > If you're using POSE 3.5, you should get a more complex error, > indicating where in the code the data that wasn't freed was allocated. If > you're not using POSE 3.5, why not? Thanks! I was using 3.3, but found the problem with 3.5. You're right, it was an unfreed pointer. I'd

Re: Can't MemPtrNew inside MemHandleLock

2002-08-16 Thread Daniel Seifert
> record = (Record *)MemPtrNew(sizeof(record)); > err = MemHandleUnlock(recordH); > err = DmReleaseRecord(currentDBRef, recordIndex, 0); > > I can work around this by just working directly with the packed record, but > I'd like to know why I can't do a MemPtrN

Re: Can't MemPtrNew inside MemHandleLock

2002-08-16 Thread Chris Tutty
From: "Jason Freund" <[EMAIL PROTECTED]> > recordH = DmGetRecord(currentDBRef, recordIndex); > PackedRecord = MemHandleLock(recordH); > record = (Record *)MemPtrNew(sizeof(record)); > At the point when sizeof(record) is called record isn't set. I

RE: Can't MemPtrNew inside MemHandleLock

2002-08-16 Thread Borislav Kolev
recordH = DmGetRecord(currentDBRef, recordIndex); PackedRecord = MemHandleLock(recordH); record = (Record *)MemPtrNew(sizeof(record)); err = MemHandleUnlock(recordH); err = DmReleaseRecord(currentDBRef, recordIndex, 0); There is nothing wrong with this code, except the line

RE: Can't MemPtrNew inside MemHandleLock

2002-08-16 Thread Kevin OKeefe
If you MemPtrNew that chunk, you need to free it somewhere - that's what that error is telling you -Original Message- From: Jason Freund [mailto:[EMAIL PROTECTED]] Sent: Friday, August 16, 2002 3:56 PM To: Palm Developer Forum Subject: Can't MemPtrNew inside MemHandleLock

Re: Can't MemPtrNew inside MemHandleLock

2002-08-16 Thread Ben Combee
eLock(recordH); > err = MemHandleUnlock(recordH); > err = DmReleaseRecord(currentDBRef, recordIndex, 0); > >But when I try to do any kind of MemPtrNew in there to alloc space for the >structure that will store the unpacked record, I get the error. For >example, this code causes

Can't MemPtrNew inside MemHandleLock

2002-08-16 Thread Jason Freund
ef, recordIndex, 0); But when I try to do any kind of MemPtrNew in there to alloc space for the structure that will store the unpacked record, I get the error. For example, this code causes the app to crash on exit: recordH = DmGetRecord(currentDBRef, recordIndex); PackedRecord = MemHan

Re: Launchcode and MemPtrNew

2002-03-25 Thread Keith Rollin
th a custom >launch code. > >Along with the launch code, I am passing some data to it for processing. >When I send the data that is present on stack the plug-in runs fine. But if >the data is allocated using MemPtrNew then the Emulator gives me error of >accessing global variable. Bu

Re: Launchcode and MemPtrNew

2002-03-25 Thread V...i...K...a...S
Palm OS Docs for more help. Regards, Vikas - Original Message - From: Akhilesh Singh <[EMAIL PROTECTED]> To: Palm Developer Forum <[EMAIL PROTECTED]> Sent: Monday, March 25, 2002 6:41 PM Subject: Launchcode and MemPtrNew > Hi, > > I am developing a plugin that is launch

Launchcode and MemPtrNew

2002-03-25 Thread Akhilesh Singh
Hi, I am developing a plugin that is launched using SysAppLaunch with a custom launch code. Along with the launch code, I am passing some data to it for processing. When I send the data that is present on stack the plug-in runs fine. But if the data is allocated using MemPtrNew then the

Is MemPtrNew valid with "non-NormalLaunch" codes?

2001-11-26 Thread George Aslanis
obals, (UInt32 *)&pTestCommGlobals)) { pTestCommGlobals = (TestCommFeature *)MemPtrNew(sizeof(TestCommFeature)); MemSet(pTestCommGlobals, sizeof(TestCommFeature), 0); FtrSet(OmniCreatorId, ftrTestCommGlobals, (UInt32)pTestCommGlobals); } Stop Debugger

MemPtrNew?

2001-06-04 Thread Madina
at message is that the application may have allocated a buffer (possibly with MemPtrNew) that wasnt large enough for its purpose... The "new" button is supposed to bring up the edit form as usual... Since this code is in the CW tutorials i didnt expect these problems...What am i doing wr

Re: MemPtrNew

2001-04-12 Thread Ritesh
You do a delete fro every new, similarly, you do a MemPtrFree fro every MemPtrNew. but what could be the error in such a case.. Tell us the details. Ritesh >:) - Original Message - From: Nicolas Raitman To: Palm Developer Forum Sent: Thursday, April 12, 2001 5:35 PM Subject: MemPtr

RE: MemPtrNew

2001-04-12 Thread DeAnna Davidson
You definitely want to call MemPtrFree each time you allocate memory with MemPtrNew. What kind of errors are you getting? DeAnna -Original Message- From: Nicolas Raitman [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 12, 2001 8:05 AM To: Palm Developer Forum Subject: MemPtrNew Do I

MemPtrNew

2001-04-12 Thread Nicolas Raitman
Do I have to call MemPtrFree each time I allocate new memory with MemPtrNew? Because sometimes, when I want to deallocate memory using MemPtrFree I have some errors... -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/tech/support

Re: Buffer size from MemPtrNew()

2001-04-09 Thread Aaron Ardiri
> Does anyone know what the maximum buffer size is that you can get from > MemPtrNew()? I would like to get a buffer as big as 512K. 64K (there is a constant, it is more like 65505) - sorry :) if you want 512K, write your own memory manager that deals with chunks of 64K - be warne

RE: Buffer size from MemPtrNew()

2001-04-09 Thread Scott Johnson (Bellevue)
> From: trevor [mailto:[EMAIL PROTECTED]] > Does anyone know what the maximum buffer size is > that you can get from MemPtrNew()? Slightly less than 64KB. This is documented in the Memory chapter of the Companion book, but for some reason is not mentioned in the Reference book

Re: Buffer size from MemPtrNew()

2001-04-06 Thread Ben Combee
"trevor" <[EMAIL PROTECTED]> wrote in message news:44982@palm-dev-forum... > > Does anyone know what the maximum buffer size is that you can get from > MemPtrNew()? I would like to get a buffer as big as 512K. MemPtrNew can only allocate 64K at a time. Also, since it a

Buffer size from MemPtrNew()

2001-04-06 Thread trevor
Does anyone know what the maximum buffer size is that you can get from MemPtrNew()? I would like to get a buffer as big as 512K. -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/tech/support/forums/

Re: memptrnew? vs malloc

2001-02-13 Thread Gary Miller
te them to a database, > immediately. Since I > don't know how big these strings will be, can I just use memPtrNew or > MemHandleNew > like I would use malloc? > > My confusion lies in the call to MemPtrFree. When I free the memory > that > I am dynamically allocating

memptrnew? vs malloc

2001-02-12 Thread LarryLu
in a struct and then write them to a database, immediately. Since I don't know how big these strings will be, can I just use memPtrNew or MemHandleNew like I would use malloc? My confusion lies in the call to MemPtrFree. When I free the memory that I am dynamically allocating for the str

  1   2   >