Comments (2)
That looks to be the case! Given this is a demonstration of taste, it is unnecessary to free memory. OS should cleanup any memory leaks on program exit.
Hope this helps answer your question!
from linked-list-good-taste.
@aidan-gallagher, @bnert, thank you for starting the discussion.
The code in this example makes no assumptions about memory management.
The remove_elegant(...)
and remove_cs101(..)
functions both take a target
pointer to a list_item
as a parameter and remove the target
item from the list. Since the calling function still has a list_item
pointer to target
(the parameter it supplied to the removal function), it can free allocated memory if appropriate.
Closing this for now.
from linked-list-good-taste.
Related Issues (12)
- Crash HOT 1
- do you think it would be doable in other languages like python for a linked list? HOT 2
- About Linus taste HOT 1
- pointer vs value equality HOT 1
- I found out the **p can be removed, which leads to lesser codes, but I don't know whether it's better or worse since it introduces a warning, what do you think? HOT 2
- A question about the implementation HOT 3
- How did you make these diagrams? HOT 1
- Value of simplicity HOT 4
- Code fails on null or item not in list. HOT 4
- test doesn't compile on GCC HOT 1
- Related to derivatives of data structures HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from linked-list-good-taste.