mirror of
https://github.com/oven-sh/bun
synced 2026-02-16 22:01:47 +00:00
use RELEASE_ASSERT (https://github.com/oven-sh/bun/pull/19940#discussion_r2116938040)
This commit is contained in:
@@ -125,14 +125,14 @@ void ScriptExecutionContext::unrefEventLoop()
|
||||
bool ScriptExecutionContext::canSendMessage()
|
||||
{
|
||||
us_loop_t* loop = (us_loop_t*)uws_get_loop();
|
||||
uint32_t currentTickNr = static_cast<uint32_t>(us_loop_iteration_number(loop));
|
||||
long long currentTickNr = static_cast<long long>(us_loop_iteration_number(loop));
|
||||
|
||||
if (lastSendTickNr != currentTickNr) {
|
||||
messagesSentThisTick = 0;
|
||||
lastSendTickNr = currentTickNr;
|
||||
}
|
||||
|
||||
constexpr uint32_t MAX_MESSAGES_PER_TICK = 1000;
|
||||
constexpr long long MAX_MESSAGES_PER_TICK = 1000;
|
||||
if (messagesSentThisTick >= MAX_MESSAGES_PER_TICK) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ public:
|
||||
}
|
||||
|
||||
uint32_t messagesSentThisTick = 0;
|
||||
uint32_t lastSendTickNr = -1; // Will be updated to the us_loop_t->data.iteration_nr every tick we send a message in
|
||||
long long lastSendTickNr = -1; // Will be updated to the us_loop_t->data.iteration_nr every tick we send a message in
|
||||
// https://github.com/oven-sh/bun/blob/d7a517cdfc31705a6b4fb696dc834ba8d98d5d3a/packages/bun-usockets/src/internal/loop_data.h#L58
|
||||
|
||||
bool canSendMessage();
|
||||
|
||||
@@ -278,8 +278,8 @@ void MessagePort::processMessages(ScriptExecutionContext& context, Vector<Messag
|
||||
dispatchEvent(event.event);
|
||||
|
||||
if (scope.exception()) [[unlikely]] {
|
||||
globalObject->reportUncaughtExceptionAtEventLoop(globalObject, scope.exception());
|
||||
scope.clearExceptionExceptTermination();
|
||||
RELEASE_ASSERT(vm.hasPendingTerminationException());
|
||||
return;
|
||||
}
|
||||
|
||||
if (Zig::GlobalObject::scriptExecutionStatus(globalObject, globalObject) == ScriptExecutionStatus::Running) {
|
||||
|
||||
Reference in New Issue
Block a user