cancel
Showing results for 
Search instead for 
Did you mean: 

How to cut down code size

JJ.Lin
Associate III

Hi,

I use some shapes in my screen view which makes the screen view class code size up to 15KB, how to cut down the code size? Can I new the object when the view is created? Will it work ?

Thanks!

3 REPLIES 3
Romain DIELEMAN
ST Employee

Hi,

What do you mean by "can I new the object" ? Do you mean initialize a shape widget in the constructor or in the setUpScreen() function in the <NameOfScreen>View.cpp ?

/Romain

Yes! For the reaseon that I use a lot of shapes object in a View class and it cost nearly 40KB code size. Can I do like this ?:

Shape<4> *shape1 = new Shape<4>();

I need only set the four points and postion which are regular so that it will cost a less code size.But is it doable?

Thanks!

Xzhiy.1
Associate II

I think it works, you may do many extra work to maitain correct data of 4 Shapes, TouchGFX Demo 3 (TouchGFX Designer 4.17.0) show SparseContainerList class which use few Container to manage many items,may give you some inspiration.