-
Notifications
You must be signed in to change notification settings - Fork 34
fix(mem): allocation checks and request abort on failed allocation #57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
e84bcd1
to
63ec20f
Compare
7a4e020
to
1ce49a5
Compare
1ce49a5
to
ead44bd
Compare
0c60155
to
240486e
Compare
7360f9c
to
eff6cb7
Compare
eff6cb7
to
8a2a88e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@me-no-dev @vortigont : I added a second commit to the PR to adjust the changes based on last comments.
I agree that we should not check for null after new Class
. Either it is allocated, or program terminates or throw.
We could use new (std:::nothrow) Class
to allow returning null.
Right now ESPAsyncWS does not use this mechanism anywhere, and within a request lifecycle, place where it would be important to abort() , we are already using a lot of new Class
, for example to create responses.
So refactoring the project to support new (std:::nothrow) Class
at many places is not possible and would also break the API because users are expecting a response object when the can beginRespsonse()
So I propose we settle on checking for null allocations only where really applicable (i.e. malloc or new arrays(
- abort request on failed allocations - std::vector => std::list for _pathParams - limit the use of std::vector in middleware code that could execute in the context of a request
8a2a88e
to
18cb706
Compare
No description provided.