Skip to content
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

refactor: Add mem module to allow tests to override allocators. #2393

Merged
merged 1 commit into from
Aug 31, 2023

Conversation

iphydf
Copy link
Member

@iphydf iphydf commented Aug 23, 2023

This will allow us to do more interesting things with memory allocation within toxcore, and allow fuzzers to explore various allocation failure paths.


This change is Reviewable

@iphydf iphydf added this to the v0.2.20 milestone Aug 23, 2023
@iphydf iphydf modified the milestones: v0.2.20, v0.2.19 Aug 23, 2023
@iphydf iphydf marked this pull request as draft August 23, 2023 11:07
@iphydf iphydf changed the title refactor: Add mem module to allow tests to override allocators. [WIP] refactor: Add mem module to allow tests to override allocators. Aug 23, 2023
@codecov
Copy link

codecov bot commented Aug 23, 2023

Codecov Report

Patch coverage: 89.54% and project coverage change: +64.49% 🎉

Comparison is base (6133fb1) 9.99% compared to head (a549807) 74.49%.

Additional details and impacted files
@@             Coverage Diff             @@
##           master    #2393       +/-   ##
===========================================
+ Coverage    9.99%   74.49%   +64.49%     
===========================================
  Files         141       87       -54     
  Lines       32530    26194     -6336     
===========================================
+ Hits         3250    19512    +16262     
+ Misses      29280     6682    -22598     
Files Changed Coverage Δ
toxcore/group_moderation.c 80.69% <50.00%> (+72.52%) ⬆️
toxcore/onion_announce.c 85.61% <62.50%> (+81.82%) ⬆️
toxcore/TCP_common.c 78.72% <75.00%> (+72.34%) ⬆️
toxcore/tox_private.c 49.27% <75.00%> (+36.04%) ⬆️
toxcore/mono_time.c 94.33% <77.77%> (+73.58%) ⬆️
toxcore/tox.c 63.69% <80.95%> (+55.89%) ⬆️
toxcore/tox_events.c 78.70% <81.81%> (+27.07%) ⬆️
toxcore/TCP_server.c 78.77% <83.33%> (+70.65%) ⬆️
toxcore/TCP_connection.c 70.86% <84.61%> (+60.48%) ⬆️
toxcore/DHT.c 84.50% <87.17%> (+74.73%) ⬆️
... and 21 more

... and 112 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

testing/fuzzing/BUILD.bazel Show resolved Hide resolved
toxcore/mem.h Show resolved Hide resolved
toxcore/TCP_connection.c Show resolved Hide resolved
toxcore/mem.h Outdated Show resolved Hide resolved
toxcore/mem.c Outdated Show resolved Hide resolved
toxcore/tox.h Outdated Show resolved Hide resolved
toxcore/tox.c Show resolved Hide resolved
@pull-request-attention pull-request-attention bot assigned iphydf and robinlinden and unassigned iphydf Aug 29, 2023
@iphydf iphydf requested a review from a team as a code owner August 30, 2023 22:32
This will allow us to do more interesting things with memory allocation
within toxcore, and allow fuzzers to explore various allocation failure
paths.
@nurupo
Copy link
Member

nurupo commented Aug 31, 2023

A bit confused by this PR and #2397 both introducing the mem module and using new system_{random,network,memory}. Is one PR build on top of another? Or perhaps these are alternative implementations of the same thing?

@iphydf iphydf merged commit a549807 into TokTok:master Aug 31, 2023
39 checks passed
@iphydf iphydf deleted the mem branch August 31, 2023 00:09
@Green-Sky
Copy link
Member

@nurupo this one introduces the mem, #2397 should just be moving stuff around (afaik)

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.

4 participants