Replacing malloc and the like with GLib's variants
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest8 patches 16 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/8 | bsd-user/elfload.c: Replaced calls to malloc/free with GLib variantsbsd-user/ | +37 | 3 replies | |
| 2/8 | hw/audio/fmopl.c: Fixing some style errorshw/ | +32 | 0 replies | |
| 3/8 | hw/audio/fmopl.c: Replaced calls to malloc with GLib's variantshw/ | +25 | 2 replies | |
| 4/8 | target/xtensa: Replaced malloc/free with GLib's variantstarget/ | +21 | 1 reply | |
| 5/8 | util/compatfd.c: Replaced a malloc with GLib's variantutil/ | +5 | 4 replies | |
| 6/8 | tools/virtiofsd/buffer.c: replaced a calloc call with GLib's g_try_new0tools/ | +2 | 2 replies | |
| 7/8 | tools/virtiofsd/fuse_opt.c: Replaced a malloc with GLib's g_try_malloctools/ | +2 | 1 reply | |
| 8/8 | tools/virtiofsd: Replacing malloc-like calls with GLib's variantstools/ tools/ tools/ | +48 | 3 replies |
Reviews trailers per patch
3 of 8 patches have a Reviewed-by or Acked-by.
| Patch | Max Filippov | Stefan Hajnoczi |
|---|---|---|
| 1/8 | ||
| 2/8 | ||
| 3/8 | ||
| 4/8 | A-b | |
| 5/8 | ||
| 6/8 | R-b | |
| 7/8 | R-b | |
| 8/8 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH 0/8] Replacing malloc and the like with GLib's variants
Inspired by the task in the Bite-sized tasks page, I've tried to change some of the occurrences of malloc(), calloc(), and realloc() calls and their respective free() calls. I also included some minor style improvements that caused errors and warnings when supplied to the checkpatch.pl script.
At numerous places, the change is quite obvious. However, some other malloc() and the like have no immediately visible free() calls. Analysis was done to trace the roots of each free() call to match each GLib function with a g_free(), and every malloc(), realloc(), or calloc() call with a call to free().
This series was resent due to some previous problems that are hopefully resolved in this series.
Mahmoud Mandour (8):
bsd-user/elfload.c: Replaced calls to malloc/free with GLib variants hw/audio/fmopl.c: Fixing some style errors hw/audio/fmopl.c: Replaced calls to malloc with GLib's variants target/xtensa: Replaced malloc/free with GLib's variants util/compatfd.c: Replaced a malloc with GLib's variant tools/virtiofsd/buffer.c: replaced a calloc call with GLib's
g_try_new0
tools/virtiofsd/fuse_opt.c: Replaced a malloc with GLib's g_try_malloc tools/virtiofsd: Replacing malloc-like calls with GLib's variants
bsd-user/elfload.c | 74 ++++++++++++++++---------------- hw/audio/fmopl.c | 68 +++++++++++++++++------------ target/xtensa/xtensa-isa.c | 53 +++++++++-------------- tools/virtiofsd/buffer.c | 4 +- tools/virtiofsd/fuse_lowlevel.c | 30 ++++++------- tools/virtiofsd/fuse_opt.c | 4 +- tools/virtiofsd/fuse_virtio.c | 34 +++++++-------- tools/virtiofsd/passthrough_ll.c | 32 +++++++------- util/compatfd.c | 10 ++--- 9 files changed, 156 insertions(+), 153 deletions(-)
Signature · 1 line
2.25.1