problem with dynamic memory in multi-files project
Posted: Fri Mar 30, 2012 6:27 am
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: 1941 Location: Norman, OK
Posted: Fri Mar 30, 2012 11:47 am
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!!!!
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