import { OBJECT, TOTAL_OVERHEAD } from "rt/common"; // @ts-ignore: Decorator valid here @inline export function bytes(o: T): i32 { if (isInteger() || isFloat()) { return sizeof(); } else if (isManaged() || isReference()) { return changetype(changetype(o) - TOTAL_OVERHEAD).rtSize; } else { ERROR("Cannot convert type " + nameof() + " to bytes!"); } }