CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

problem with dynamic memory in multi-files project

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
iporboon



Joined: 29 Mar 2012
Posts: 2

View user's profile Send private message

problem with dynamic memory in multi-files project
PostPosted: Fri Mar 30, 2012 6:27 am     Reply with quote

Dear sir.
I used PIC18F4553 and PIC16F877 with CCS V4.
I did multi-file compilation unit for my project and it worked fine.
But when I used dynamic memory functions (calloc/malloc) in my programs, those functions did not work. They returned NULL pointers.

I read the Multiple Compilation Units topic in Help file and followed it.
I also included stdlibm.h in the common header file of the project.
I debugged it with MPLABSIM and I saw the variable DYNMIC_HEAD was zero, that caused malloc/calloc returned NULL pointer .

I also did single-file project with malloc/calloc and it worked correctly.

Best Rgds.
dyeatman



Joined: 06 Sep 2003
Posts: 1933
Location: Norman, OK

View user's profile Send private message

PostPosted: Fri Mar 30, 2012 11:47 am     Reply with quote

Which CCS version 4? It will be a number 4.xxx . If my memory serves the earlier versions had problems in this area.
_________________
Google and Forum Search are some of your best tools!!!!
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
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