xiaoxiang781216 commented on PR #10602:
URL: https://github.com/apache/nuttx/pull/10602#issuecomment-1722147867

   > I fully understand vfs, no callback infrastructure is needed,
   
   > that's a glibc patch, who cares?
   
   But I care where the implementation is elegance and extendable.  The code 
like spaghetti should avoid as mention in:
   https://github.com/apache/nuttx/blob/master/INVIOLABLES.md?plain=1#L36-L41
   https://github.com/apache/nuttx/blob/master/INVIOLABLES.md?plain=1#L90-L94
   
   > just deal with a flag about memory provider that's it.
   
   even for memory stream, there are at least two cases:
   
   1. fmemopen work on a fix size array(provided by caller, or allocated by 
self)
   2. open_memstream work on an allocate/reallocate extendable memory
   
   The detail is evil, you have to add more flags/fields and many if/else in 
many common places to handle the different behavior required by spec. The 
callback is better design here to encapsulate the difference behind the 
differerent callback(fd vs. mem, fixed vs. dynamically).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to