-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Eliminate fopen() in cfg.rl. Use unbuffered i/o instead.
This is fairly tricky, but fopen() almost surely interally calls malloc when it creates the FILE* that it returns. I did promise that ndhc doesn't call malloc after initialization, besides what libc may do internally, but it feels a bit dishonest given that fopen() is basically sure to do so on any general-purpose libc. Thus, eliminate it and just use direct POSIX i/o. With the previous pidfile changes, ndhc doesn't use C fopen() at all. In practice, this change won't really be noticeable as most libcs, particularly with dynamic linking, will end up calling malloc themselves during program initialization before main() is invoked.
- Loading branch information
Showing
1 changed file
with
50 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters