I'm trying to use a lighter primitive array, because storing hundreds of thousands NSNumbers in a NSMutableDictionary is causing like 40-50MB memory consumption..
This is my code:
NSUInteger highestModelID = [self.externalDB intForQuery:@"SELECT `id` FROM `models` ORDER BY `id` DESC"];
CGFloat modelsPricesForCustomer[highestModelID];
memset(modelsPricesForCustomer, 0, highestModelID*sizeof(NSUInteger));
NSLog(@"%i", highestModelID);
NSLog(@"%lu", (sizeof modelsPricesForCustomer));
highestModelID
is 34078
, yet the size says it's 136312
. Do I allocate it wrong or read it wrong?