mozilla / r2d2b2g

Firefox OS Simulator is a test environment for Firefox OS. Use it to test your apps in a Firefox OS-like environment that looks and feels like a mobile phone.
https://addons.mozilla.org/en-US/firefox/addon/firefox-os-simulator/
Other
392 stars 139 forks source link

Switch to thread local storage from cutils. #820

Closed brendandahl closed 11 years ago

brendandahl commented 11 years ago

Fixes #782

Luckily cutils has a thread local storage implementation already. Some notes:

Aside: we need to do some work on the build system, there's way to much to change just to add a file.

bkase commented 11 years ago

Awesome! This looks good. Is libadb working in XP now?

Sorry about the build system problems -- it's pretty hacky (especially those batch files in Windows). I can try to at least consolidate the list of files to one spot in one of the Makefiles. Let me know if that would be helpful.

mykmelez commented 11 years ago

Aside: we need to do some work on the build system, there's way to much to change just to add a file.

Indeed!

Sorry about the build system problems -- it's pretty hacky (especially those batch files in Windows). I can try to at least consolidate the list of files to one spot in one of the Makefiles. Let me know if that would be helpful.

That would be very helpful!

mykmelez commented 11 years ago

Awesome! This looks good. Is libadb working in XP now?

Yes, with this changeset, libadb builds, loads, and works on XP.

mykmelez commented 11 years ago

Storing the js_msg function pointer in tls is tricky since data pointer aren't guaranteed to be the same size as function pointers. Casting to void* seems to be fine on osx and windows xp, but I'm not sure about the linux 64 distros.

I built and tested on three linux64 distros, and it seems to work correctly on them:

mykmelez commented 11 years ago

Do you have any leads on the cause of this leak?

Erm, sorry, I mean the crash! In any case, I'm comfortable with this, provided we don't forget about the problem, so I filed #825 on it.