Path: ...!eternal-september.org!feeder2.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: candycanearter07 Newsgroups: comp.os.linux.misc Subject: Re: Joy of this, Joy of that Date: Mon, 25 Nov 2024 04:40:03 -0000 (UTC) Organization: the-candyden-of-code Lines: 38 Message-ID: References: <6iKdnTQOKNh6AqD6nZ2dnZfqn_idnZ2d@earthlink.com> <20241120081039.00006d2a@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Date: Mon, 25 Nov 2024 05:40:03 +0100 (CET) Injection-Info: dont-email.me; posting-host="d26c70e7f62be0b914e96dff17e9d8d8"; logging-data="2777168"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/MiWqOWkA7S/CrS6fD6KnjxiChTfcsZnEOY3ZFUF98ug==" User-Agent: slrn/1.0.3 (Linux) Cancel-Lock: sha1:gVRUKUyQI2YXAHQktQt1i11SxTc= X-Face: b{dPmN&%4|lEo,wUO\"KLEOu5N_br(N2Yuc5/qcR5i>9-!^e\.Tw9?/m0}/~:UOM:Zf]% b+ V4R8q|QiU/R8\|G\WpC`-s?=)\fbtNc&=/a3a)r7xbRI]Vl)r<%PTriJ3pGpl_/B6!8pe\btzx `~R! r3.0#lHRE+^Gro0[cjsban'vZ#j7,?I/tHk{s=TFJ:H?~=]`O*~3ZX`qik`b:.gVIc-[$t/e ZrQsWJ >|l^I_[pbsIqwoz.WGA] wrote at 21:40 this Saturday (GMT): > On Sat, 23 Nov 2024 19:16:04 GMT, Charlie Gibbs wrote: > >> On 2024-11-23, Lawrence D'Oliveiro wrote: >> >>> On Sat, 23 Nov 2024 07:09:11 GMT, Charlie Gibbs wrote: >>> >>>> On 2024-11-22, Lawrence D'Oliveiro wrote: >>>> >>>>> On Fri, 22 Nov 2024 18:53:28 GMT, Charlie Gibbs wrote: >>>>> >>>>>> All my programs contain a routine called quit_cleanup(); it takes a >>>>>> single argument, which is either an error message or NULL. >>>>>> It frees all allocated memory, closes any open files, etc. >>>>> >>>>> But all that is unnecessary if your program is terminating anyway. >>>> >>>> Perhaps, but I'm a belt-and-suspenders guy - I like to explicitly free >>>> everything come hell or high water. >>> >>> That actually slows down program termination. >> >> The microsecond or two that is wasted is far less than the debugging >> time needed when a shortcut goes wrong. > > Actually, thinking about it, there are some things -- shared memory > sections come to mind -- that are not automatically freed when a process > terminates. But everything else -- memory, open files, network connections > -- will go away automatically. > > If you have those persistent things that you want to clean up, your > technique won’t be reliable anyway. Does it get freed up when the other processes that have it open also close it, or is it stuck until shutdown? -- user is generated from /dev/urandom