robbieduncan
Apr 24, 07:54 AM
Actually there is a malloc, it's embedded in the memcpy.
My mistake. But the underlying problem is the same: the address of returnElement is on the stack. The address of the memory the at malloced in the call to memcpy is "lost" as it is never saved into a variable. So that malloced memory is leaked.
But, if I understand you correctly, the act of copying from the heap to the stack has the same effect of free()?
No. Absolutely 100% not. You have allocated space on the heap with the malloc. The malloc returned the address for you to free later. You did not save this address so cannot call free but that is OK as memcpy also returns the destination address (so as you can put the memcpy and malloc in one line like you have). But you fail to save the address their, instead dereferencing the pointer and saving that value in a variable. So at this point the malloced space on the heap is leaked. This is a problem. The space you allocated on the stack for the double is fine: it will get cleaned up for you.
The solution is to split this into two lines. You need to have a void * pointer variable that you store the return from memcpy in. You can then dereference and cast the that into returnElement. And finally free the void * pointer returned from memcpy.
My mistake. But the underlying problem is the same: the address of returnElement is on the stack. The address of the memory the at malloced in the call to memcpy is "lost" as it is never saved into a variable. So that malloced memory is leaked.
But, if I understand you correctly, the act of copying from the heap to the stack has the same effect of free()?
No. Absolutely 100% not. You have allocated space on the heap with the malloc. The malloc returned the address for you to free later. You did not save this address so cannot call free but that is OK as memcpy also returns the destination address (so as you can put the memcpy and malloc in one line like you have). But you fail to save the address their, instead dereferencing the pointer and saving that value in a variable. So at this point the malloced space on the heap is leaked. This is a problem. The space you allocated on the stack for the double is fine: it will get cleaned up for you.
The solution is to split this into two lines. You need to have a void * pointer variable that you store the return from memcpy in. You can then dereference and cast the that into returnElement. And finally free the void * pointer returned from memcpy.
vincenz
Aug 8, 08:18 PM
The last set would be perfect for when the in-laws come over.
d4nn0
Dec 16, 04:42 PM
thanks for the advice... unfortunately warranty was up in july, but luckily it's still working fine... it's as if it worked the problem out of its system or something haha. I'm just gonna hope that I keep having good luck and wait for the mactels :cool:
Hellhammer
Apr 24, 02:18 AM
At least not in the base model. In theory, Apple could replace the 3.2GHz quad BTO option with 3.2GHz 6-core but personally, I doubt that. However, you can buy the base model and do the upgrade on your own.
more...
rsanuri
Jan 12, 07:47 PM
Since there is Airtunes, Airport, Airbook would be a possible name...
If not this is refering to AirTV...
Just speculation.
RSA
If not this is refering to AirTV...
Just speculation.
RSA
Blue Fox
Jul 6, 05:29 AM
Seems that everyone always has an issue with Apple product except for me. I guess I should consider myself lucky?
more...
bowens
Apr 11, 07:37 AM
Last night I was in Walmart picking up Super Paper Mario and the guy working there says, "So you got one of those Wii things, huh?." I replied, "Yeah, do you have one yet." He says, "No, we can't keep them in stock. We still have people lining up at midnight to get them. Every shipment is sold within 4 hours."
This is in a very small town. A little ol' redneck town in Florida. This thing is incredible.
This is in a very small town. A little ol' redneck town in Florida. This thing is incredible.
Peace
Aug 6, 02:07 PM
Wow..
At least she's keeping warm..:)
At least she's keeping warm..:)
more...
Richard14
Apr 4, 09:42 AM
How do i know what format the drive is in?
olternaut
Sep 8, 12:52 AM
This would be a nice feature and would fit with Apple's way of doing things.
Guess we'll know soon.
This guy seems confident though doesn't he? :p
Guess we'll know soon.
This guy seems confident though doesn't he? :p
more...
jicon
Sep 29, 01:24 PM
http://www.apple.com/support/downloads/macosx1048updateintel.html
Over Achiever
Sep 8, 08:25 PM
Originally posted by arn
I don't think anyone actually thought TiBooks/iBooks would be updated at Paris...
the only hints have been low powerbook supply reports (which are nonspecific), and a competely BS report about dual G5's via reader email at MacBidouille.
arn
What? What reader e-mail? :D
Anyway, they expected G5s? Duals is already crazy (read my sig), but G5s? Before they are introduced into powermacs? Wishful thinking!:D
I don't think anyone actually thought TiBooks/iBooks would be updated at Paris...
the only hints have been low powerbook supply reports (which are nonspecific), and a competely BS report about dual G5's via reader email at MacBidouille.
arn
What? What reader e-mail? :D
Anyway, they expected G5s? Duals is already crazy (read my sig), but G5s? Before they are introduced into powermacs? Wishful thinking!:D
more...
sk4prez2020
Dec 28, 06:43 PM
Glad to see they are making improvements finally. I don't think that Mobile Me is worth the fee now that the "Find My iPhone" feature is free. :apple:
ReverendCharm
Mar 27, 08:01 PM
well i bought a new firewire cable thinking maybe that was the problem but now the dam external drive wont even show up on the desktop (or system profiler).. neither cable is able to bring the drive up on the desktop but it works fine with USB 2 ...it must be either my mac mini firewire port or the port on the drive and since i never used my firewire port on the mini before then my money is on the drive being faulty
more...
steadysignal
May 6, 09:44 AM
enjoy your vaca.
i will be going on one soon too.
i will be going on one soon too.
Gokhan
Nov 28, 05:56 PM
i can offer 70$ shipped to the uk !
sorry all i got very low i know :)
sorry all i got very low i know :)
more...
Krizoitz
Jan 27, 12:02 PM
Can anyone point me to where the membership level numbers are spelled out. I've been trying to find the information but haven't had any luck. Thanks
Blackhatch
Apr 5, 08:30 AM
What is your budget? What do you expect to do with the camera? What lighting conditions? Will you be recording audio using the camera or an external device? What mics do you have/plan to get? How will it be supported? What do you plan to edit with? What is your final output?
Budget - I would like to keep it under $800
Lighting conditions - should be very good as I will normally be shooting in daylight and clear weather.
Mics - I don't have any but will get whatever is required. I was going to add most of the audio after the fact for clarity's sake.
Edit - Not sure. Whatever is most friendly and easy to work with.
Output - This will be video content for my website.
Basically...I am a contractor that wants to post of some video of completed jobs with some audio about what we do and why.
Budget - I would like to keep it under $800
Lighting conditions - should be very good as I will normally be shooting in daylight and clear weather.
Mics - I don't have any but will get whatever is required. I was going to add most of the audio after the fact for clarity's sake.
Edit - Not sure. Whatever is most friendly and easy to work with.
Output - This will be video content for my website.
Basically...I am a contractor that wants to post of some video of completed jobs with some audio about what we do and why.
bennetsaysargh
Jul 25, 02:05 PM
i would say call applecare.
as for the dog issue, i never knew that!
oh well, i don't have a dog:(
as for the dog issue, i never knew that!
oh well, i don't have a dog:(
5300cs
Sep 24, 10:11 PM
I believe this is a continuing love saga.
Er, I thought MyMemory was getting maried though :confused:
Er, I thought MyMemory was getting maried though :confused:
atrac7
Apr 6, 01:27 AM
^^Exactly what i did! All good now :)
Out of curiosity, why did you use a third party charger? I've done it a few times with other devices, but it's always been with quality, branded chargers (like charging my Kindle with my BlackBerry's charger), but I wouldn't dare do that with my iPad unless I knew it was top quality since so many of those third party chargers, like third party batteries, can damage your equipment.
By the way, I think using a third party charger may have voided your warranty anyway. At least on some devices I'm pretty sure it does.
Honestly I was using the same charger...just was an extension, so the tip was different...
Out of curiosity, why did you use a third party charger? I've done it a few times with other devices, but it's always been with quality, branded chargers (like charging my Kindle with my BlackBerry's charger), but I wouldn't dare do that with my iPad unless I knew it was top quality since so many of those third party chargers, like third party batteries, can damage your equipment.
By the way, I think using a third party charger may have voided your warranty anyway. At least on some devices I'm pretty sure it does.
Honestly I was using the same charger...just was an extension, so the tip was different...
hexagonheat
Aug 12, 10:49 PM
Ugh Quicktime is terrible and needs to die. I dislike it almost as much as I disliked realplayer back in the late 90's.
hackerpro
Mar 26, 01:21 AM
Hey guys, sorry if this question is asked often.
I have an iPod Touch 4G that I had jailbroken on 4.2.1, but I messed with some system files that I shouldn't have messed with and I had to restore and update to 4.3. Is there anyway I can downgrade to 4.2.1 so I can jailbreak again?
You can but its very complicated you must have your 4.2.1 file saved
I have an iPod Touch 4G that I had jailbroken on 4.2.1, but I messed with some system files that I shouldn't have messed with and I had to restore and update to 4.3. Is there anyway I can downgrade to 4.2.1 so I can jailbreak again?
You can but its very complicated you must have your 4.2.1 file saved
tnsmart
Apr 12, 05:00 PM
Thanks for the replies.
I have an ATT iphone and the Trim fits perfectly. I also run with my phone and it fits fine in my Belkin armband w/o removing the case. I also like that the case comes with a dock insert. So far it has been the perfect case for me
How well does the Trim protect your phone? If I dropped my iPhone on a parking lot from about 3 feet do you think it would be ok?
Also, could you tell me which Belkin armband you have?
I do like CapsuleRebel but think that it may be a bit too bulky, especially for putting into an armband.
Does anybody have any comments on the Vulcan?
Thanks.
I have an ATT iphone and the Trim fits perfectly. I also run with my phone and it fits fine in my Belkin armband w/o removing the case. I also like that the case comes with a dock insert. So far it has been the perfect case for me
How well does the Trim protect your phone? If I dropped my iPhone on a parking lot from about 3 feet do you think it would be ok?
Also, could you tell me which Belkin armband you have?
I do like CapsuleRebel but think that it may be a bit too bulky, especially for putting into an armband.
Does anybody have any comments on the Vulcan?
Thanks.
No comments:
Post a Comment