Changeset 55f5c59
- Timestamp:
- May 30, 2017, 11:44:48 AM (7 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- d6fb3c7
- Parents:
- bff607e
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/user/user.tex
rbff607e r55f5c59 11 11 %% Created On : Wed Apr 6 14:53:29 2016 12 12 %% Last Modified By : Peter A. Buhr 13 %% Last Modified On : Tue May 30 09:08:16201714 %% Update Count : 20 7213 %% Last Modified On : Tue May 30 11:42:47 2017 14 %% Update Count : 2097 15 15 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 16 16 … … 5238 5238 5239 5239 The storage-management routines extend their C equivalents by overloading, alternate names, providing shallow type-safety, and removing the need to specify the allocation size for non-array types. 5240 5241 Storage management provides the following capabilities: 5242 \begin{description} 5243 \item[fill] 5244 after allocation the storage is or is not filled with a specified character. 5245 \item[resize] 5246 an existing allocation is decreased or increased in size. 5247 In either case, new storage may or may not be allocated and, if there is a new allocation, as much data from the existing allocation is copied. 5248 For an increase in storage size, new storage after the copied data may or may not be filled. 5249 \item[alignment] 5250 an allocation starts on a specified memory boundary, e.g., an address multiple of 64 or 128 for cache-line purposes. 5251 \item[array] 5252 the allocation size is scaled to the specified number of array elements. 5253 An array may or not be filled, resized, or aligned. 5254 \end{description} 5255 5256 The following table show the allocation routines supporting different combinations of storage-management capabilities: 5240 5257 \begin{center} 5241 5258 \begin{tabular}{@{}r|l|l|l|l@{}} … … 5252 5269 \end{tabular} 5253 5270 \end{center} 5254 When ©amalloc© resizes and fills, the space after the copied data from the source is set to the fill character.5271 % When ©amalloc© resizes and fills, the space after the copied data from the source is set to the fill character. 5255 5272 It is impossible to resize with alignment because the underlying ©realloc© allocates storage if more space is needed, and it does not honour alignment from the original allocation. 5256 5273 … … 5338 5355 \begin{cfa}[aboveskip=0pt,belowskip=0pt] 5339 5356 forall( otype T | { int ?<?( T, T ); } ) §\C{// location}§ 5340 T * bsearch( T key, const T * arr, size_t dim ension);§\indexc{bsearch}§5357 T * bsearch( T key, const T * arr, size_t dim );§\indexc{bsearch}§ 5341 5358 5342 5359 forall( otype T | { int ?<?( T, T ); } ) §\C{// position}§ 5343 unsigned int bsearch( T key, const T * arr, size_t dim ension);5360 unsigned int bsearch( T key, const T * arr, size_t dim ); 5344 5361 5345 5362 forall( otype T | { int ?<?( T, T ); } ) 5346 void qsort( const T * arr, size_t dim ension);§\indexc{qsort}§5363 void qsort( const T * arr, size_t dim );§\indexc{qsort}§ 5347 5364 \end{cfa} 5348 5365
Note: See TracChangeset
for help on using the changeset viewer.