VFS GetAllData() and memory allocation

Eunsoo Roh <[email protected]>
Newsgroups gmane.comp.graphics.crystalspace.devel
Message-ID <[email protected]>
Currently, iFile::GetAllData() returns the buffer (or mmap()'d pointer) via iDataBuffer interface. The problem is, the same data is used for read and write operations as well. Since iDataBuffer interface do not support read-only Apparently, documentation warns the user not to try to modify the content of buffer. Yet, I am uneasy because of its inherent danger (or imperfections) in design/linguistic perspective. welltall suggested to leave it alone as it is user's fault if they try to do that. I'm wondering everyone agrees with this decision; or any other suggestions on this? In addition, old VFS uses its own heap allocator to allocate memory in iFile/VfsNode implementation. Specifically, they access a private heap object within csVFS class. It works as it is tightly coupled. New design, however, is more loosely coupled via interfaces. I'm not sure how I should approach this. I'm just using cs_malloc() for now, yet wondering what private heap is for and what advantages it can provide. Anyone have any ideas or suggestions? touko

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/

_______________________________________________
Crystal-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/crystal-develop
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.