gallium: add interface for querying memory usage and sizes (v2)