Fix heap snapshots memory usage stats. Introduce estimateDirectMemoryUsageOf function in "bun:jsc" (#15790)

This commit is contained in:
Jarred Sumner
2024-12-16 20:16:23 -08:00
committed by GitHub
parent 3906d02e2c
commit aada6f930f
55 changed files with 1093 additions and 99 deletions

View File

@@ -73,6 +73,10 @@ public:
DROPPED
};
size_t memoryCost() {
return getBufferedAmount() + sizeof(WebSocket);
}
/* Sending fragmented messages puts a bit of effort on the user; you must not interleave regular sends
* with fragmented sends and you must sendFirstFragment, [sendFragment], then finally sendLastFragment. */
SendStatus sendFirstFragment(std::string_view message, OpCode opCode = OpCode::BINARY, bool compress = false) {