private unsafe void PopulateEvents(RuntimeType.RuntimeTypeCache.Filter filter, RuntimeTypeHandle declaringTypeHandle, Hashtable csEventInfos, List <RuntimeEventInfo> list)
        {
            int token = declaringTypeHandle.GetToken();

            if (!MetadataToken.IsNullToken(token))
            {
                MetadataImport metadataImport = declaringTypeHandle.GetModuleHandle().GetMetadataImport();
                int            count          = metadataImport.EnumEventsCount(token);
                int *          result         = stackalloc int[count]; //result.AllocatedUntil = count
                metadataImport.EnumEvents(token, result, count);
                this.PopulateEvents(filter, declaringTypeHandle, metadataImport, result, count, csEventInfos, list);
                //Ensures that result.AllocatedUntil >= count!
            }
        }