arrays - Manual memory management in C++ -


Summary of the Code: More than 1.6 million UITs 8_T stores in a 3D array as indicators of those UIT 8_t.

This code works, but why is it that I saved only 4 KB using UIT 8_T, as opposed to ints. I use this same code with inset 330,488K, but it uses 330,484 with UIT 8_T. I know that most of these are indicators but to reduce the size of 16 million ints from 2 beets to 1 byte (more than 440 is left) I do not want to reduce everybody I'm thinking it saved as much as 16 MB Should have been?

"Run the same code with inters." I really find one "Find and replace: INT8_t int" then recompile it again.

  uint8_t **** num3d; Num3d = new uint8_t *** [256]; For (int i = 0; i  60) {B = new UIT 8_T (1); Number 3d [lx] [li] [lj] = b; to continue; } B = new UIT 8_ T (0); Number 3d [lx] [li] [lj] = b; } // internal inner loop} // external loop} // external loop  

" My question is, what is it about the int that allows it to use full 32 bit ints and how can I already do this program with ints to use with 8 bit ints. I know that they should include memory management in general management 'Uint8_t is not included with.'

Well, int is at least 16 bits, 32 bits are not guaranteed. But ignoring this, the fact is that each integral There is a certain type of type std :: numeric_limits or will tell you the related categories, of course, you 0 You can not use 8 bit numbers to count to 256. You can count only up to 255.

In addition, there is no memory management for int Au Other common types like uint_8 . The compiler says that "the integer of the name Fu is stored in these bytes" and this is the same. There is no management required, there are some small variations, e.g. A int member of a structure is stored in "these bytes of structure" etc.


Comments