Changes between Version 1 and Version 2 of Ticket #3666, comment 112
- Timestamp:
- 11/07/16 12:06:10 (8 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #3666, comment 112
v1 v2 33 33 a. Require that the caller allocates an obviously large enough buffer, maybe 64 bytes or so, and don't care about this any more. 34 34 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 anybenefit. 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.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 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. 36 36 37 37 c. The formatter method dynamically allocates a large enough new string. 38 38 39 d. Some higher level object (e.g. GStrin ) is used.39 d. Some higher level object (e.g. GString) is used. 40 40 41 41 And, totally independently from this: