|
Members in Shoutbox
None.
Shoutbox Search
Shoutbox Commands
/w [name] > Whisper
/r > Reply to last whisper /me > Marks as action Shoutbox Information
Moderators may delete any and all shouts at will.
|
Global Shoutbox
Please log in to shout.
[2014-10-13. : 4:34 am] O)FaRTy1billion[MM] -- Also when destroying the album, you might not want to decrement album size, because that will cause the for loop to terminate early[2014-10-13. : 4:34 am] Zoan -- Ahhh, I've got it! So the negation of the statement "For all rational and irrational numbers, their sum is irrational" is "There exists a rational and irrational number such that their sum is rational." jjf, you didn't show that the negation of the statement was false - you should that the statement "For all rational and irrational numbers their sum is rational" is false, but you would have to have shown that the statement "There exists a rational and an irrational number whose sum is rational" is false[2014-10-13. : 4:34 am] trgk -- FaRTy1billionFaRTy1billion shouted: yeah. Or you can just put a zero-width space in there What is zero-width space?[2014-10-13. : 4:33 am] O)FaRTy1billion[MM] -- Also, unrelated, but you have print_photo and destroy_photo and then proceed to not use them by copying their functionality elsewhere. ![]() [2014-10-13. : 4:31 am] O)FaRTy1billion[MM] -- when you add photos to the album, you aren't incrementing album->size so it's overwriting the first photo every timeun[2014-10-13. : 4:31 am] Dem0n -- hm now that I'm reading that, I don't even think I need to change the album's size in the destroy_album() function[2014-10-13. : 4:29 am] O)FaRTy1billion[MM] -- As far as I know, I don't have a problem with leaky code ... Really my check is just open task manager, run the program, and then load/close/load/close a bunch of stuff over and over and see if the used memory goes up and never back down. ![]() [2014-10-13. : 4:29 am] trgk -- If i see 'safe_malloc : %d' and don't see 'safe_free : %d', then I found a memory leak.[2014-10-13. : 4:28 am] trgk -- they printed the address as it malloc/free to stderr, so I could that they match pair by pair as the program runs[2014-10-13. : 4:27 am] trgk -- I usually have created custom safe_malloc and safe_free functions to find leaks[2014-10-13. : 4:26 am] O)FaRTy1billion[MM] -- is there any other memory that is allocated but never deallocated?[2014-10-13. : 4:23 am] Dem0n -- there's a function that prints the Photo's description, so would I free the memory after the description has been printed? But what if I want to reprint that Photo's description?[2014-10-13. : 4:23 am] * jjf28 mind off*[2014-10-13. : 4:23 am] Dem0n -- But then I also have the Photo description whose memory is dynamically allocated, and I never free that, but I have no clue where I'd free that[2014-10-13. : 4:22 am] Dem0n -- I have a function that creates a dynamically allocates memory to create a Photo and returns it, and then I have a function that destroys the photo, so I just deallocate the memory for that photo there[2014-10-13. : 4:20 am] O)FaRTy1billion[MM] -- dunno. Where do you have mallocs, and is that memory freed?[2014-10-13. : 4:20 am] jjf28 -- comment out mallocs/recheck till it no longer occurs; brute force ftw[2014-10-13. : 4:18 am] O)FaRTy1billion[MM] -- because if you have "Waffles", strlen will return 7 when it really takes 8 bytes[2014-10-13. : 4:16 am] O)FaRTy1billion[MM] -- usually if I have a static array where I need the size of it it's defined with a #define[2014-10-13. : 4:16 am] O)FaRTy1billion[MM] -- I don't think I've ever done sizeof on a string or array. xD[2014-10-13. : 4:15 am] O)FaRTy1billion[MM] -- if it's a constant sizeof might work, but otherwise it would be strlen(char1)+1[2014-10-13. : 4:14 am] Dem0n -- Wait, if I have a string that I want to copy, but I first need to allocate memory for it, would I do char2 = (char *) malloc(strlen(char1))?[2014-10-13. : 4:13 am] Dem0n -- What does this mean: "Address [...] is 0 bytes after a block of size 9 allocated"[2014-10-13. : 4:11 am] Dem0n -- it's some command that you can use that shows you were you get memory leaks[2014-10-13. : 4:11 am] O)FaRTy1billion[MM] -- images_tbl + *(((unsigned short*)images_tbl)+imagesdat.grpfile[img]) -- being lazy is way higher than making pretty code. ![]() [2014-10-13. : 4:10 am] jjf28 -- it had a tiny speck of something right inbetween the eyebrows of that ' ' |
Roy