bagder,
@bagder@mastodon.social avatar

In the #curl project, being written in C, we always work on simplifying the code. One way is to use more internal helper functions and avoid direct use of some functions that are often involved in C mistakes/vulnerabilities.

To measure how this develops, we count number of these function calls used per every thousand lines of code. Over time.
In a graph.

janvhs,
@janvhs@hachyderm.io avatar

@bagder is it true that every C program / library “invents” their own memory management system at some point?
I heard that statement multiple times now and this data seems to add to the validity of it.

I never thought about this, but maybe Zig and Rust are really on to something with their memory management APIs. (Idk, how Hare and Embedded Swift manage this sort of thing)

bagder,
@bagder@mastodon.social avatar

@janvhs I would not call what curl does as "memory management", I would call it helper functions for managing dynamic buffers. And yes, I believe that is common for many C programs.

rogersm,
@rogersm@mastodon.social avatar

@bagder good software engineering here.

FrankGevaerts,
@FrankGevaerts@mastodon.social avatar

@bagder A graph? But it's not Friday!

efi,
@efi@chitter.xyz avatar

@bagder wouldn't this be better juxtaposed to the total count of uses? like this an increase in lines of code shows like a decrease in usage which is not intuitive

bagder,
@bagder@mastodon.social avatar

@efi normally they would grow at the same rate as the number of lines and I don't find that too interesting.

I might try a version that adds two plots with the absolute numbers against a second Y axis.

efi,
@efi@chitter.xyz avatar

@bagder it is a fair assumption, but I see that peak on the left and I have to wonder if the project grew a lot that time or it just added a lot of copy calls

bagder,
@bagder@mastodon.social avatar

@efi this is number of lines of code over time

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • ngwrru68w68
  • rosin
  • GTA5RPClips
  • osvaldo12
  • love
  • Youngstown
  • slotface
  • khanakhh
  • everett
  • kavyap
  • mdbf
  • DreamBathrooms
  • thenastyranch
  • magazineikmin
  • megavids
  • InstantRegret
  • normalnudes
  • tacticalgear
  • cubers
  • ethstaker
  • modclub
  • cisconetworking
  • Durango
  • anitta
  • Leos
  • tester
  • provamag3
  • JUstTest
  • All magazines