Changes between Version 1 and Version 2 of Ticket #3666, comment 112


Ignore:
Timestamp:
11/07/16 12:06:10 (3 years ago)
Author:
egmont
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #3666, comment 112

    v1 v2  
    3333a. Require that the caller allocates an obviously large enough buffer, maybe 64 bytes or so, and don't care about this any more. 
    3434 
    35 b. Require that the caller tells us the available storage space, and if and only if we would write beyond that, the formatter method bails out with an error and then the caller allocates a larger buffer and tries again. Very complex to implement for hardly any benefit. Mostly used in system calls (see e.g. readline(2)) because the kernel cannot allocate new memory for the user. I firmly vote against this approach in mc. 
     35b. Require that the caller tells us the available storage space, and if and only if we would write beyond that, the formatter method bails out with an error and then the caller allocates a larger buffer and tries again. Very complex to implement for no benefit. Mostly used in system calls (see e.g. readline(2)) because the kernel cannot allocate new memory for the user. I firmly vote against this approach in mc. 
    3636 
    3737c. The formatter method dynamically allocates a large enough new string. 
    3838 
    39 d. Some higher level object (e.g. GStrin) is used. 
     39d. Some higher level object (e.g. GString) is used. 
    4040 
    4141And, totally independently from this: