(entries: Array<number | PriorityLevel>)
| 32 | const SchedulerResumeEvent = 8; |
| 33 | |
| 34 | function logEvent(entries: Array<number | PriorityLevel>) { |
| 35 | if (eventLog !== null) { |
| 36 | const offset = eventLogIndex; |
| 37 | eventLogIndex += entries.length; |
| 38 | if (eventLogIndex + 1 > eventLogSize) { |
| 39 | eventLogSize *= 2; |
| 40 | if (eventLogSize > MAX_EVENT_LOG_SIZE) { |
| 41 | // Using console['error'] to evade Babel and ESLint |
| 42 | console['error']( |
| 43 | "Scheduler Profiling: Event log exceeded maximum size. Don't " + |
| 44 | 'forget to call `stopLoggingProfilingEvents()`.', |
| 45 | ); |
| 46 | stopLoggingProfilingEvents(); |
| 47 | return; |
| 48 | } |
| 49 | const newEventLog = new Int32Array(eventLogSize * 4); |
| 50 | // $FlowFixMe[incompatible-call] found when upgrading Flow |
| 51 | newEventLog.set(eventLog); |
| 52 | eventLogBuffer = newEventLog.buffer; |
| 53 | eventLog = newEventLog; |
| 54 | } |
| 55 | eventLog.set(entries, offset); |
| 56 | } |
| 57 | } |
| 58 | |
| 59 | export function startLoggingProfilingEvents(): void { |
| 60 | eventLogSize = INITIAL_EVENT_LOG_SIZE; |
no test coverage detected