Angband.oook.cz
Angband.oook.cz
AboutVariantsLadderForumCompetitionComicScreenshotsFunniesLinks

Go Back   Angband Forums > Angband > Development

Reply
 
Thread Tools Display Modes
Old October 29, 2016, 07:45   #1
t4nk
Adept
 
Join Date: May 2016
Posts: 249
t4nk is on a distinguished road
Some memory leaks (low priority)

So I spent some time with Valgrind, there are some small memory leaks:
1) parse_buy_flag() (store.c) makes a string "t" and never frees it
2) cleanup_artifact() (init.c) frees brands and slays of artefacts, but doesnt free curses
3) cleanup_player() (player.c) frees player->obj_k, but doesn't free its curses, brands and slays
Also, I'm curious if anyone makes use of the functionality of mem_alloc() and co. at this point? As far as I can tell, its main reason to exist is to make Valgrind produce some additional "potentially lost" warnings
t4nk is offline   Reply With Quote
Old October 30, 2016, 01:05   #2
takkaria
Veteran
 
takkaria's Avatar
 
Join Date: Apr 2007
Posts: 1,826
Donated: $40
takkaria is on a distinguished road
Quote:
Originally Posted by t4nk View Post
So I spent some time with Valgrind, there are some small memory leaks:
1) parse_buy_flag() (store.c) makes a string "t" and never frees it
2) cleanup_artifact() (init.c) frees brands and slays of artefacts, but doesnt free curses
3) cleanup_player() (player.c) frees player->obj_k, but doesn't free its curses, brands and slays
Also, I'm curious if anyone makes use of the functionality of mem_alloc() and co. at this point? As far as I can tell, its main reason to exist is to make Valgrind produce some additional "potentially lost" warnings
Should be fixed in master, thanks.

The only thing that mem_alloc() really needs to do that malloc() doesn't is die on failure. The debug stuff can probably go at this point.
__________________
"Physician, heal thyself."
takkaria is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Angband 4.0] Massive memory leaks + possible double-free on object pointers PowerWyrm Development 5 April 17, 2015 12:08
very low priority feature request - metric system option bebo Vanilla 20 April 28, 2012 09:08
Low vision Nethack Dark Idle chatter 9 February 25, 2012 00:46
Low Brow Question z118 Vanilla 6 February 2, 2010 16:02
Equivalents to ***LOW HP WARNING*** for other situations? pampl Vanilla 6 June 12, 2009 10:49


All times are GMT +1. The time now is 06:41.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2017, vBulletin Solutions, Inc.