Memory maker and gadget designer SanDisk (NASDAQ:SNDK) just reported a better-than-expected quarter, with a little help from its friends -- and enemies.

The flash memory market has been in freefall for more than a year. An industrywide production glut has driven down the price any of the manufacturers could charge for their products, to the tune of occasional 30% sequential price drops, quarter by quarter. Manufacturing costs aren't exactly fixed, thanks to new designs more conducive to low-cost construction and increased manufacturing efficiencies. But those expenses are still constrained enough to make it impossible to turn a profit on flash memory under these conditions.

Even though SanDisk's GAAP earnings were just about quartered from last year, however, it still turned a decently hefty profit. Retail demand for flash-based gadgets "recovered nicely" in the quarter, said CEO Eli Harari, who expects gross margins to improve over the next few months as well. It seems the balance between supply and demand has tipped, diminishing some of the industry's chronic oversupply issues.

Harari credits "the flurry of new Flash memory enabled, highly innovative consumer and mobile products coming from our customers, our competitors, and ourselves," which he thinks will keep consumer demand nice and high well into next year.

At the same time, the warehouses of memory makers like SanDisk, Micron (NYSE:MU), Samsung, and Spansion (NASDAQ:SPSN), which used to bulge with unsold product fresh off the production lines, have gone on a diet. If SanDisk management's predictions hold true, the other sector players should start reporting lower inventories as well. That's a double whammy of crosswise stimulation from friends and foes alike, both in the sales channel and on the supply side. Nice!

Harari sees his company benefiting more than most from this industry turnaround, thanks to its leading technology position, low-cost in-house manufacturing, and strong distribution channels. From a broader perspective, and taken together with positive reports or expectations from the likes of Nokia (NYSE:NOK), Texas Instruments (NYSE:TXN), and Apple (NASDAQ:AAPL), this looks like another signal that consumers are happy to open their wallets, even in a housing-market downturn. I guess home equity loans aren't the only liquidity source out there, huh?

Further Foolishness:

Fool contributor Anders Bylund holds no position in any of the companies discussed here. Well, he does own shares in AMD, which is Spansion's largest shareholder. You can check out Anders' holdings if you like, and you've got a friend in Foolish disclosure.