malloc() not working correctly in PSoC4

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Although under the System-tab in creator one may define some space for the heap malloc() does not become initialized correctly as it is the case for PSoC5. Thus the first call to malloc() returns a NULL pointer.

   

I will file a technical case immediately.

   

 

   

Bob

0 Likes
8 Replies
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

Does the second call to malloc() then succeed?

   

(When I read something like that, I'm always remined of http://pragmatictips.com/26 ...)

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Since the first call went amiss I didn't try a second call. I would never ever trust a library-routine that doesn't work at first call.

   

 

   

Bob

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

How about a routine that works for all calls except the 137'th ?

   

 

   

Of course that leads us to explain why 137'th failed, then we have to discuss

   

Heisenburg uncertainty principle, FLASH and RAM read errors, noise, errors due to

   

Kim Jong-um EMP weapons..........

   

 

   

 

   

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Well, that reminds me at the age when I wrote an absolute unbeatable subroutine that was able to calculate within 2µs the square-root of a number, I only forgot which one.

   

 

   

Bob

0 Likes
Anonymous
Not applicable

 Hi Bob,

   

This was a bug in the compiler and will be fixed in a future version of Creator.

0 Likes
Anonymous
Not applicable

We're expecting a new version of Creator in the Fall.

0 Likes
Anonymous
Not applicable

Any information of what is changed to the new creator 3.0?

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

No official infos yet.

   

I'd overcome the malloc() issue only by providing my own library routine

   

 

   

Bob

0 Likes