Author Topic: int takes 4 bytes  (Read 141 times)

AKotowski

  • RFduino Jr. Member
  • **
  • Posts: 22
  • Karma: +0/-0
    • View Profile
int takes 4 bytes
« on: August 29, 2017, 08:48:28 AM »
Using simblee, integer types are calculated to 16 bits.  However the compiler allocates 4 bytes of storage.  I am storing arrays of integer and it is chewing up a lot of memory.  Is this a bug, or is there some reason ints take 4 bytes?

tolson

  • Global Moderator
  • *****
  • Posts: 870
  • Karma: +20/-0
    • View Profile
    • Thomas Olson Consulting
Re: int takes 4 bytes
« Reply #1 on: August 29, 2017, 01:36:10 PM »
Integers on ARM Cortex M0 are 32 bits. Thus the 4 bytes.

 

anything