Skip to content

Update task queue to allow operator new overloads to overload all memory allocation#928

Merged
jasonsandlin merged 5 commits intomainfrom
user/brianpe/leaks
Feb 13, 2026
Merged

Update task queue to allow operator new overloads to overload all memory allocation#928
jasonsandlin merged 5 commits intomainfrom
user/brianpe/leaks

Conversation

@brianpepin
Copy link
Copy Markdown
Contributor

Task queue uses an internal class called LocklessQueue, which is a low level lock-free queue implementation. LocklessQueue creates a block of node objects to hold internal state. Those node objects must be properly aligned in memory for LocklessQueue to work. This was done with aligned mallocs, which bypasses any user-supplied operator new overrides.

This change addresses that by switching LocklessQueue to use standard new / delete via alignas and alignof attributes.

In addition this change contains small payload changes done to the Windows version of TaskQueue:

  • There were some internal flags (CanClose / CanTerminate) used specifically when creating the default process task queue. These are no longer needed so the logic was deleted.
  • It is now possible to uninitialize the task queue library, which cleans up the default process task queue.

None of these additional changes is interesting for libHttp, but we need to keep the source code in lockstep with what Windows is using.

@jasonsandlin jasonsandlin merged commit 2e2f704 into main Feb 13, 2026
15 checks passed
@jasonsandlin jasonsandlin deleted the user/brianpe/leaks branch February 13, 2026 01:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants