M
mickey
I know this may sound ridiculous but I need sanity check. I am
developing in c++ for an embedded device where memory is tight and I
have a class which always upon initialization dynamically allocates a
10kb buffer. Since this type of class object is always dynamically
allocated, I am wondering if there is any advantage to allocating the
buffer dynamically. I am thinking the buffer can simply be defined and
statically allocated as a class member? One obvious drawback is if I
ever decide to allocate the class statically and that would be
impossible in the confines of the embedded device stack. Feedback is
welcomed, thanks.
developing in c++ for an embedded device where memory is tight and I
have a class which always upon initialization dynamically allocates a
10kb buffer. Since this type of class object is always dynamically
allocated, I am wondering if there is any advantage to allocating the
buffer dynamically. I am thinking the buffer can simply be defined and
statically allocated as a class member? One obvious drawback is if I
ever decide to allocate the class statically and that would be
impossible in the confines of the embedded device stack. Feedback is
welcomed, thanks.