bladox.com Forum Index bladox.com
Turbo SIM Toolkit Adapter Forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Memory corruption / strange behavior

 
Post new topic   Reply to topic    bladox.com Forum Index -> Development
View previous topic :: View next topic  
Author Message
jacko



Joined: 20 Dec 2010
Posts: 19

PostPosted: Mon Feb 14, 2011 4:03 pm    Post subject: Memory corruption / strange behavior Reply with quote

Hello,

I am having big issues developing with a TL2.
I have many bugs, which might be related to a heap corruption or something like that.

The documentation lacks details about what a STK thread is. What does stk_thread() do exactly? If I allocate memory with malloc() within a stk_thread, is it available to the other stk_threads ? (for instance if I have a global pointer)

How much stack is available? How much heap?

Is there a way to known the remaining memory in the heap at any time?

It's very hard for me to develop with TSIM because when there's a bug I don't know if it's in my code, or if it's in the way I use the OS functions.

Thanks
Back to top
View user's profile Send private message
pz



Joined: 12 Mar 2004
Posts: 1161

PostPosted: Mon Feb 14, 2011 4:30 pm    Post subject: Re: Memory corruption / strange behavior Reply with quote

jacko wrote:
Hello,

I am having big issues developing with a TL2.
I have many bugs, which might be related to a heap corruption or something like that.

The documentation lacks details about what a STK thread is. What does stk_thread() do exactly? If I allocate memory with malloc() within a stk_thread, is it available to the other stk_threads ? (for instance if I have a global pointer)


Yes, it's available to other threads. It's not thread like e.g. posix thread - potentially parallel process with separated memory. It's a loop that handles STK commands that is started from main gsm loop (that handles all apdus).

There is just one heap for all apps, there is no MMU.

Quote:

How much stack is available? How much heap?

Is there a way to known the remaining memory in the heap at any time?

It's very hard for me to develop with TSIM because when there's a bug I don't know if it's in my code, or if it's in the way I use the OS functions.

Thanks


You can try to use db_malloc() and company, see debug.h
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    bladox.com Forum Index -> Development All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group