The FlushGC() macro checks the dirty bits in the library's GC structure and calls _XFlushGCCache() if any elements have changed.
Note that if you extend the GC to add additional resource ID components, you should ensure that the library stub sends the change request immediately. This is because a client can free a resource immediately after using it, so if you only stored the value in the cache without forcing a protocol request, the resource might be destroyed before being set into the GC. You can use the _XFlushGCCache() procedure to force the cache to be flushed.