lue inside head with the value returned by the
GetCharPtr() API, lets say it is 0x0200.
when you do:
MemPtrFree(head);
you should be doing:
MemPtrFree(0x0100);
but, instead are doing:
MemPtrFree(0x0200);
and, 0x02000 is a pointer that wasn't allocated using M
char *head;
head = (char *) MemPtrNew(100);
head = text->GetCharPtr(header);
you allocate 100 bytes; lets say it has a memory location 0x0100.
you then *replace* the value inside head with the value returned by the
GetCharPtr() API, lets say it is 0x0200.
when you do:
MemPtrF
rum
Subject: MemPtrFree
Hi alll...
I used a char poniter for holding a string. I have done this by
first initializing the pointer memory with MemPtrNew. After the process
i tried releasing the memory with MemPtrFree. After reaching the
MemPtrFree point the application breaks with an er
Hi alll...
I used a char poniter for holding a string. I have done this by
first initializing the pointer memory with MemPtrNew. After the process
i tried releasing the memory with MemPtrFree. After reaching the
MemPtrFree point the application breaks with an error "MemoryMgr.c,
C allows casting from void * to other pointer types without an explicit cast.
C++ requires the cast to compile.
-Original Message-
From: Logan Shaw <[EMAIL PROTECTED]>
Subj: Re: MemPtrFree
Date: Mon Oct 10, 2005 1:14 am
Size: 1K
To: "Palm Developer Forum"
JAME
JAMES S HAINES wrote:
For some reason PODS 1.2 indicates an error via a red square in the upper
right hand corner of the editor whenever I try to release an unmovable chunk
of memory by MemPtrFree(p). Perhaps I'm using it incorrectly or perhaps a
bug in PODS?? I have included a function
For some reason PODS 1.2 indicates an error via a red square in the upper
right hand corner of the editor whenever I try to release an unmovable chunk
of memory by MemPtrFree(p). Perhaps I'm using it incorrectly or perhaps a
bug in PODS?? I have included a function below as an example of
Hello,
I don't mean 'not trust with MemPtrFree'. So far error
i got had relation to memory leaks.
However, it is fine now. It was solved. Thanks
expert(s) for all your help/suggestion.
regards,
Peter Alex
--- Ben Combee <[EMAIL PROTECTED]> wrote:
> At 01:42 AM 5/2
At 01:42 AM 5/21/2004, you wrote:
Hi experts,
1. can i use 'MemPtrFree' to free-up memory claimed
with 'MemGluePtrNew'?
Yes, MemPtrFree is the appropriate API to use to free that memory.
2. Please advice how to 'really' free-up memory
claimed by 'MemGluePtrNew
> 1. can i use 'MemPtrFree' to free-up memory claimed
>with 'MemGluePtrNew'?
yes.
> 2. Please advice how to 'really' free-up memory
>claimed by 'MemGluePtrNew'/'MemPtrNew' so any variable
>created with those methods a
Hi experts,
1. can i use 'MemPtrFree' to free-up memory claimed
with 'MemGluePtrNew'?
2. Please advice how to 'really' free-up memory
claimed by 'MemGluePtrNew'/'MemPtrNew' so any variable
created wit
fine. But calling MemPtrFree does not actually
free the memory. Here's the code I'm using minus code that actually does
the drawing and manipulating the data.
char *string1; // string pointer def.
string1 = MemPtrNew(sizeof(char) * 7); // allocating string pointer me
What I'm trying to do is have a gadget display a number which I store in
a TimeType variable as the gadget's data, then on drawing I take the
numbers out of the TimeType variable and convert them to a string using
StrIToA everything seems to work fine. But calling MemPtrFree does not
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
: 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
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
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
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
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
non-movable memory, I believe you can do it like so:
UInt32 *myVar
myVar = (*UInt32) MemPtrNew(sizeof(UInt32));// allocates a UInt32 on the
dynamic heap
*myVar = 1;// set its value
//free the memory
MemPtrFree(myVar);
// note, because this is non moval memory, you should not keep it
ious thread.
So, I've decided I should take a serious look at using "MemPtrNew" and
"MemPtrFree" to make the application more efficient.
However, I don't know how to use them.
This is the existing code in my Pilot Main:
UInt32 PilotMain(UInt16 cmd, MemPtr cmdPB
On Mon, 16 Feb 2004 10:01:52 +0100, "christer" <[EMAIL PROTECTED]>
wrote:
>I have two global variables:
>
>Char *downloadX;
>Char *downloadY;
>
>In StartApplication() I do:
>
>downloadX = (Char*)MemPtrNew(1024);
>downloadY = (Char*)MemPtrNew(1024);
>
;
> downloadX = (Char*)MemPtrNew(1024);
> downloadY = (Char*)MemPtrNew(1024);
>
> And i StopApplication() I do:
>
> MemPtrFree(downloadX);
> MemPtrFree(downloadY);
>
> POSE gives me a "bus error" because of the MemPtrFree() calls in
> StopApplication(). If
I have two global variables:
Char *downloadX;
Char *downloadY;
In StartApplication() I do:
downloadX = (Char*)MemPtrNew(1024);
downloadY = (Char*)MemPtrNew(1024);
And i StopApplication() I do:
MemPtrFree(downloadX);
MemPtrFree(downloadY);
POSE gives me a "bus error" because of the
Yeap, you're right...
Thanks Chris
Agus
-Message d'origine-
De : [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] la part de Chris
Tutty
Envoyé : mercredi 25 juin 2003 01:22
À : Palm Developer Forum
Objet : Re: MemPtrFree - invalid chunk
From: "Agus Silas" <[EMAI
From: "Agus Silas" <[EMAIL PROTECTED]>
> In fact, I've moved the free session from the end of the AppEventLoop to
> AppStop. I thougt that I "cut" then "paste", but instead I "copy" then
> "paste", so I freed twice.
>
A good way to avoid this error, or at least prevent it
causing problems is to s
Stupid me
Agus
-Message d'origine-
De : [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] la part de Aaron
Ardiri
Envoyé : mardi 24 juin 2003 13:36
À : Palm Developer Forum
Objet : Re: MemPtrFree - invalid chunk
> do you have the pb in Debug and in Release mode?
> Perhaps
> do you have the pb in Debug and in Release mode?
> Perhaps you should resize up the stack (in project setting
> in CodeWarrior)
i dont see how making the stack larger will help him in this case. :)
he uses a global variable to store the pointer. and, he is not
allocating too much for it to cra
> When I quit my application, I got an error "Invalid Chunk ptr".
> It seems that I do not free the memory allocated correctly, but
> I don't see what is wrong in my code ???
the memory code looks fine - that should not be causing your
error to occur - most likely it is somewhere else in your
c
: Re: MemPtrFree - invalid chunk
do you have the pb in Debug and in Release mode?
Perhaps you should resize up the stack (in project setting in CodeWarrior)
- Original Message -
From: "Agus" <[EMAIL PROTECTED]>
Newsgroups: palm-dev-forum
To: "Palm Developer Forum" &l
nt: Tuesday, June 24, 2003 12:24 PM
Subject: MemPtrFree - invalid chunk
> Hi all,
>
> Here's my code looks like :
>
>
> // global
> char**gsListBuffer;
>
> static void AppEventLoop(void)
> {
> int i;
>
> gsListBuffer = (char **) MemPtrNew
} while ();
}
static void AppStop(void)
{
int i;
// free listbox buffer
for ( i = 0; i < 8; i++ ) MemPtrFree ( (char *)gsListBuffer[i] );
MemPtrFree ( (char **) gsListBuffer );
}
When I quit my application, I got an error "Invalid Chunk ptr". It seems
t
Sorry to say this but an exception on MemPtrFree is almost always the
program's fault. Try checking the pointer to see if its valid before
calling MemPtrFree. Make sure you didn't over-bound the variable, i.e.
allocate 10 bytes and stuff 11 chars into it. Also try posting some of
HI,
Make sure the original pointer is not changed.
Some code would help!
Regards,
Danny
www.toysoft.ca
-Original Message-
From: Chris Massey [mailto:[EMAIL PROTECTED]]
Sent: November 19, 2002 3:44 PM
To: Palm Developer Forum
Subject: Still getting MemPtrFree errors !
HI again
HI again...
Tried everything I canI allocate space using MemPtrNew, free it using
MemPtrFree. I get an exception on MemPtrFree, or memory leaks if I don't.
Any clues ? anybody else had this ?
Chris
--
For information on using the Palm Developer Forums, or to unsubscribe, pleas
I stand corrected. The warning/error message that I was thinking about was
freeing a freed handle (i.e. the error message is Free handle).
I apologize about that. I should make sure I don't have my wires crossed
before posting (obviously)!
Brad
"Keith Rollin" <[EMAIL PROTECTED]> wrote in messa
I will double check my statement! You would probably know better than I. I
will try to re-create the error message and will let you know!
Brad
"Keith Rollin" <[EMAIL PROTECTED]> wrote in message
news:101282@palm-dev-forum...
>
> At 5:35 PM -0700 11/15/02, Brad Figler wrote:
> >The simulator will
At 5:35 PM -0700 11/15/02, Brad Figler wrote:
The simulator will, however, tell you that you are freeing a locked chunk.
Are you sure about that? I can't find anything in the sources that
checks for that when freeing a handle. What message does it give
you? Perhaps I could search on that.
Freeing unlocked memory is OK. There is no need to unlock a locked block
first. It should not cause the crash Chris Massey is reporting.
-- Keith
-Original Message-
From: Bill Andreozzi [mailto:billandr@;statuspro.tv]
Sent: Friday, November 15, 2002 3:29 PM
To: Palm Developer Forum
Subject
Subject: Re: MemPtrFree causes exception
Chris is right, you more than likely may have been trying to free memory
that you have not unlocked first, try calling unlock, then free.
thanks - bill
"Chris Massey" <[EMAIL PROTECTED]> wrote in message
news:101110@;palm-dev-forum...
>
>
my app on the emulator. When I call
> MemPtrFree to free the ptrs allocated with MemPtrNew I get a big fat
error.
> But without it I get leaks !! What the is going on ? Help !!
>
> Chris
>
>
>
>
--
For information on using the Palm Developer Forums, or to unsu
From: "Chris Massey" <[EMAIL PROTECTED]>
> So I get memory leaks when exiting my app on the emulator. When I call
> MemPtrFree to free the ptrs allocated with MemPtrNew I get a big fat
error.
> But without it I get leaks !! What the is going on ? Help !!
>
Off
So I get memory leaks when exiting my app on the emulator. When I call
MemPtrFree to free the ptrs allocated with MemPtrNew I get a big fat error.
But without it I get leaks !! What the is going on ? Help !!
Chris
--
For information on using the Palm Developer Forums, or to
Thank you to all who replied to my question. Your tips have solved my
problem.
Walter Black
BuildNet, Inc
Software Engineer
[EMAIL PROTECTED]
919-941-4752
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/
"Walter Black" <[EMAIL PROTECTED]> wrote in message
news:17293@palm-dev-forum...
>
> Hello All,
> I'm attempting to use the following code but I get an error when I free
the
> memory. What am I doing wrong?
>
> CharPtr typeP;
> ListPtr listP;
> typeP = MemPtrNew(10);
> listP = GetObjectPtr(Detai
Looks to me like you're trying to free memory that you didn't allocate. Probably the
memory manager is complaining because it can't find the chunk header, which would
happen if the memory in question is just part of a larger chunk, such as the chunk
allocated by Palm OS for the form.
--
Peter E
listP, LstGetSelection(listP));
... /*do something with typeP*/
MemPtrFree(typeP);
The error does not have any text when using CW6. Any help would be
appreciated. Thanks
Walter Black
BuildNet, Inc
Software Engineer
[EMAIL PROTECTED]
919-941-4752
--
For information on using the
47 matches
Mail list logo