Changeset 5faa3a5 for doc/theses/mike_brooks_MMath/background.tex
- Timestamp:
- Apr 28, 2026, 8:56:08 AM (21 hours ago)
- Branches:
- master
- Parents:
- bf8112b
- File:
-
- 1 edited
-
doc/theses/mike_brooks_MMath/background.tex (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
doc/theses/mike_brooks_MMath/background.tex
rbf8112b r5faa3a5 463 463 however, it requires all dimensions except the first to be specified at compile time, \eg @m[][6]@, allowing all subscripting stride calculations to be generated with constants. 464 464 Hence, every matrix passed to @fp1@ must have exactly 6 columns but the row size can vary. 465 The variable-dimension approach (right) ignores (violates) the type system, \ie the parameter type has no suggestion of mu tidimensionality and some acrobatics are required for a w\footnote{465 The variable-dimension approach (right) ignores (violates) the type system, \ie the parameter type has no suggestion of multidimensionality and some acrobatics are required for a w\footnote{ 466 466 One may be tempted to phrase a call as \lstinline{fp2( 4, 4, vm1 )}, but this call is ill-typed. Argument \lstinline{vm1} could match parameter declarations \lstinline{int m[][4]} or \lstinline{int (*m)[4]}. But only the argument \lstinline{&vm1[0][0]}, or its equivalent, but confusing, \lstinline{vm1[0]}, relate \lstinline{vm1} to parameter type \lstinline{int*}. 467 467 }, and subscripting is performed manually using pointer arithmetic in the macro @sub@. … … 534 534 Nevertheless, the C array-of-array form is still important for special circumstances. 535 535 536 \VRef[Figure]{f:ContiguousNon-contiguous} shows a powerful extension made in C99, for manipulating contiguous \vs non-contiguous arrays.\footnote{C90 also supported non-contiguous arrays. Though GNU-flavoured C++ eventually got VLAs, it never got this enhancement for managing a multidimension l VLA parameter. }536 \VRef[Figure]{f:ContiguousNon-contiguous} shows a powerful extension made in C99, for manipulating contiguous \vs non-contiguous arrays.\footnote{C90 also supported non-contiguous arrays. Though GNU-flavoured C++ eventually got VLAs, it never got this enhancement for managing a multidimensional VLA parameter. } 537 537 For contiguous-array arguments (including VLA), C99 conjoins one or more of the parameters as a downstream dimension(s), \eg @cols@, implicitly using this parameter to compute the row stride of @m@. 538 538 Hence, if the declaration of @fc@ is changed to: … … 1184 1184 \end{c++} 1185 1185 It turns out that @TAILQ_REMOVE@ uses its ``which element to remove'' parameter at several places, importantly, one occurring after the removal's changes are in progress. 1186 When the second use encounters the macro substitution @TAILQ_LAST(reqs, reql)@, it obtains a different node than the first use got, with the removal's changes having alre dy started.1186 When the second use encounters the macro substitution @TAILQ_LAST(reqs, reql)@, it obtains a different node than the first use got, with the removal's changes having already started. 1187 1187 This macro-induced phenomenon led to an invalid pointer dereference (safety violation), at a run-time well after the removal at issue (costly to resolve). 1188 1188
Note:
See TracChangeset
for help on using the changeset viewer.