Posted Sep 10, 2006 at 10:20PM by Ian C. Listed in: Nintendo DS Tags: DS WiFi Library, Stephen Stair, malloc
Ó

WiFi LibWe've reported on Stephen Stair, his Wiki, and his DS Wifi Library before. So we've decided to follow up on the guy and see what he's been up to. In the latest post at his blog, we noticed a few development notes for the Wifi Lib 0.3a. Here's what Stephen had to say about the bug he's discovered in 0.3a. The short version of what he's said? Basically if your wifi lib's been crashing on you, it's probably his fault. Stephen assures that the bug will be fixed when the next version 0.3b is released. He says he's doing his best to get 0.3b out as fast as he can:

"In the wifi lib, when receiving packets and under a few other circumstances, the Wifi lib in its present form performs a malloc call from within the Wifi_Timer() call, and can also perform a malloc call from within the Wifi_Sync function, for FIFO messages - the only problem is both of those calls are often within interrupts, so the possibility of pre-empting a malloc in 'normal' code (which, malloc is also called in printf, for reference) is nontrivial. The only problem with this, is that malloc wasn’t really designed for that, so a malloc call preempting another malloc call can cause fatal problems, corrupt the heap, or crash your code.

There are a few ways to deal with this problem, the first of which is to use a seperate heap allocator, which is the solution I'll be incorperating into 0.3b. Those of you in the know can also implement some form of locking, wrapping allocation calls in interrupt disabling code, or something similar. Another thing to make note of is this modification will cause the wifi lib to eat up a specific amount of memory on startup (which will be user selectable, probably set to 64k or 128k for a default) - there will also be the option to disable the new memory management if you have your own solution; which will be an extra flag that will be necessary to use in the init call!"




[Via Stephen'sWeblog] Permalink  |   Email this  |   Linking Blogs   |   Digg It!

Bookmark / Find this article on:


0 Comments


Sort by:


Featured Content
QJ.NET Blog Network RSS Feeds
MyQJ Feed / PDA
MyQJ RSS / PDA
Blog of Blogs Feed / PDA
QJ.NET RSS / PDA
Gaming Consoles Feed / PDA
Nintendo DS RSS / PDA
PlayStation 3 RSS / PDA
PSP Updates RSS / PDA
Wii RSS / PDA
Xbox 360 RSS / PDA
PC Gaming Feed / PDA
Age of Conan RSS / PDA
Games for Windows RSS / PDA
MMORPG RSS / PDA
Tabula Rasa RSS / PDA
World of Warcraft RSS / PDA
Science Feed / PDA
Science RSS / PDA
Technology Feed / PDA
Apple RSS / PDA
Gadgets RSS / PDA
Mobile RSS / PDA
Photography RSS / PDA
Tech RSS / PDA
Add QJ.NET
Add to My Yahoo!
Google Reader Subscribe with Bloglines
Add  to your Kinja digest Subscribe in NewsGator Online
Subscribe with Pluck RSS reader Add 'www.qj.net' to Newsburst from CNET News.com
Subscribe with SearchFox RSS del.icio.us www.qj.net
Add to Technorati Favorite! Add to My AOL
furl! it Stumble for Treehugger!