pub fn calculate_heap_cost(heap_size: u32, heap_cost: u64) -> u64
Only used in macro, do not use directly!