This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Compiler/TMS320F28075: new operator definition

Part Number: TMS320F28075

Tool/software: TI C/C++ Compiler

Hi all

I have a C++ programm for my Piccolo controller and have already implemented the global new operator, which is working fine for creation of single objects.

1st question: is it even necessary to implement it, or is there a standard definition beeing delivered with the SYS/BIOS?

Further, for array creation another implementation of the new operator is used, but I did not implement it nor can I find the implementation in the source files.

2nd question: can you tell me where I find the implementation of the new operator for arrays? How can I overrule this standard behaviour of this certain new operator?

Cheers and thanks in advance
benjo

Compiler V16.9.5 LTS
SYS/BIOS V6.46

  • The compiler provides a default definition for all of the standard global operator new's. The implementation calls malloc and free, so even if you use the SYS/BIOS version of malloc and free, you shouldn't need to provide your own global operator new if all you want is to use the same dynamic allocation method as the rest of your program. That is, you shouldn't need to provide your own operator new unless you want some special behavior.

    There are no configuration options in the source code for the compiler's version of operator new. If you want to override them, you just declare your own operator new of the appropriate prototype. Nonetheless, the implementation is in the library source directory. Look for any file with "new" in the name, such as lib/src/array_new.cpp and lib/src/vec_newdel.cpp These files are pretty complicated. I'm pretty sure you're better off leaving them alone.