Skip to content

Commit c29255e

Browse files
committed
Make pool self-contained, remove verbose logging, add MemoryPools
This change was supposed to be pretty minor, but it required larger changes to the rest of the project. The goal was to remove the verbose logging while testing (because the new Http Client does a bit of fuzzing, so this is called _a lot_ more) AND to make the loop self-contained, so that callers didn't have to call the onRecv, onSend and onConnect callbacks (to decrement the `events_nb`). -- Unexpected breaking change #1 -- I also decided to add a MemoryPool for the IO.Completion used by timeout and cancel, as well as a MemoryPool for the ContextTimeout and ContextCancel. This caused a build failure due to an internal dependency loop. The issue is that the interfaces check requires the Loop, but I made the Loop-type dependent on the JsCallback (because it now has a MemoryPool(ContextTimeout) field which has a JsCallback. But JsCallback isn't available until the interfaces check passes! -- Unexpected breaking change #2 -- More minor, but I removed the `unrechable` from the code and made the functions return an error. I think we should avoid having runtime-unreachable as much as possible. -- Unknown change #1 -- Not clear if the inner IO loop had to be a pointer (`io: *IO`), but I changed it to `io: IO`, and everything seems to work.
1 parent d27f5d2 commit c29255e

File tree

5 files changed

+111
-374
lines changed

5 files changed

+111
-374
lines changed

src/engines/v8/callback.zig

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -119,11 +119,6 @@ pub const FuncSync = struct {
119119
func.index_offset,
120120
) orelse unreachable;
121121

122-
std.debug.print("idx: {d}, offset: {d}, {any}\n", .{
123-
func.callback_index.?,
124-
idx,
125-
js_func_val,
126-
});
127122
if (!js_func_val.isFunction()) {
128123
return error.JSWrongType;
129124
}

src/interfaces.zig

Lines changed: 0 additions & 237 deletions
This file was deleted.

0 commit comments

Comments
 (0)