Convert some misc record layer functions for size_t