Changes in doc/user/user.tex [d92ff4a:e10537a9]
- File:
-
- 1 edited
-
doc/user/user.tex (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
doc/user/user.tex
rd92ff4a re10537a9 1 1 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -*- Mode: Latex -*- %%%%%%%%%%%%%%%%%%%%%%%%%%%% 2 %% 2 %% 3 3 %% Cforall Version 1.0.0 Copyright (C) 2016 University of Waterloo 4 4 %% 5 5 %% The contents of this file are covered under the licence agreement in the 6 6 %% file "LICENCE" distributed with Cforall. 7 %% 8 %% user.tex -- 9 %% 7 %% 8 %% user.tex -- 9 %% 10 10 %% Author : Peter A. Buhr 11 11 %% Created On : Wed Apr 6 14:53:29 2016 12 12 %% Last Modified By : Peter A. Buhr 13 %% Last Modified On : Thu Jul 26 17:29:05201814 %% Update Count : 336 613 %% Last Modified On : Mon Jul 9 10:49:52 2018 14 %% Update Count : 3361 15 15 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 16 16 … … 72 72 73 73 % Names used in the document. 74 \newcommand{\Version}{\input{ ../../version}}74 \newcommand{\Version}{\input{build/version}} 75 75 \newcommand{\Textbf}[2][red]{{\color{#1}{\textbf{#2}}}} 76 76 \newcommand{\Emph}[2][red]{{\color{#1}\textbf{\emph{#2}}}} … … 430 430 #endif 431 431 \end{cfa} 432 which conditionally includes the correct header file, if the program is compiled using \Indexc{gcc} or \Indexc{cfa}. 432 which conditionally includes the correct header file, if the program is compiled using \Indexc{gcc} or \Indexc{cfa}. 433 433 434 434 … … 1447 1447 \end{cfa} 1448 1448 Algol68 infers the following dereferencing ©*p2 = *p1 + x©, because adding the arbitrary integer value in ©x© to the address of ©p1© and storing the resulting address into ©p2© is an unlikely operation. 1449 Unfortunately, automatic dereferencing does not work in all cases, and so some mechanism is necessary to fix incorrect choices. 1449 Unfortunately, automatic dereferencing does not work in all cases, and so some mechanism is necessary to fix incorrect choices. 1450 1450 1451 1451 Rather than inferring dereference, most programming languages pick one implicit dereferencing semantics, and the programmer explicitly indicates the other to resolve address-duality. … … 2282 2282 struct T t; 2283 2283 } s; 2284 2284 2285 2285 2286 2286 … … 2354 2354 } 2355 2355 \end{cfa} 2356 because 2356 because 2357 2357 2358 2358 Currently, there are no \Index{lambda} expressions, \ie unnamed routines because routine names are very important to properly select the correct routine. … … 3394 3394 sout | sepDisable | 1 | 2 | 3 | endl; // globally turn off implicit separator 3395 3395 sout | sepEnable | 1 | 2 | 3 | endl; // globally turn on implicit separator 3396 3396 3397 3397 sout | 1 | sepOff | 2 | 3 | endl; // locally turn on implicit separator 3398 3398 sout | sepDisable | 1 | sepOn | 2 | 3 | endl; // globally turn off implicit separator … … 5967 5967 void * memalign( size_t align, size_t size );§\indexc{memalign}§ 5968 5968 int posix_memalign( void ** ptr, size_t align, size_t size );§\indexc{posix_memalign}§ 5969 } 5970 5971 // §\CFA§ safe equivalents, i.e., implicit size specification 5972 forall( dtype T | sized(T) ) T * malloc( void ); 5973 forall( dtype T | sized(T) ) T * calloc( size_t dim ); 5974 forall( dtype T | sized(T) ) T * realloc( T * ptr, size_t size ); 5975 forall( dtype T | sized(T) ) T * memalign( size_t align ); 5976 forall( dtype T | sized(T) ) T * aligned_alloc( size_t align ); 5977 forall( dtype T | sized(T) ) int posix_memalign( T ** ptr, size_t align ); 5978 5979 // §\CFA§ safe general allocation, fill, resize, array 5980 forall( dtype T | sized(T) ) T * alloc( void );§\indexc{alloc}§ 5981 forall( dtype T | sized(T) ) T * alloc( char fill ); 5982 forall( dtype T | sized(T) ) T * alloc( size_t dim ); 5983 forall( dtype T | sized(T) ) T * alloc( size_t dim, char fill ); 5984 forall( dtype T | sized(T) ) T * alloc( T ptr[], size_t dim ); 5985 forall( dtype T | sized(T) ) T * alloc( T ptr[], size_t dim, char fill ); 5986 5987 // §\CFA§ safe general allocation, align, fill, array 5988 forall( dtype T | sized(T) ) T * align_alloc( size_t align ); 5989 forall( dtype T | sized(T) ) T * align_alloc( size_t align, char fill ); 5990 forall( dtype T | sized(T) ) T * align_alloc( size_t align, size_t dim ); 5991 forall( dtype T | sized(T) ) T * align_alloc( size_t align, size_t dim, char fill ); 5969 5992 5970 5993 // C unsafe initialization/copy 5994 extern "C" { 5971 5995 void * memset( void * dest, int c, size_t size ); 5972 5996 void * memcpy( void * dest, const void * src, size_t size ); 5973 5997 } 5974 5998 5975 forall( dtype T | sized(T) ) {5976 // §\CFA§ safe equivalents, i.e., implicit size specification5977 T * malloc( void );5978 T * calloc( size_t dim );5979 T * realloc( T * ptr, size_t size );5980 T * memalign( size_t align );5981 T * aligned_alloc( size_t align );5982 int posix_memalign( T ** ptr, size_t align );5983 5984 // §\CFA§ safe general allocation, fill, resize, array5985 T * alloc( void );§\indexc{alloc}§5986 T * alloc( char fill );5987 T * alloc( size_t dim );5988 T * alloc( size_t dim, char fill );5989 T * alloc( T ptr[], size_t dim );5990 T * alloc( T ptr[], size_t dim, char fill );5991 5992 // §\CFA§ safe general allocation, align, fill, array5993 T * align_alloc( size_t align );5994 T * align_alloc( size_t align, char fill );5995 T * align_alloc( size_t align, size_t dim );5996 T * align_alloc( size_t align, size_t dim, char fill );5997 5998 5999 // §\CFA§ safe initialization/copy, i.e., implicit size specification 5999 T * memset( T * dest, char c );§\indexc{memset}§6000 T * memcpy( T * dest, const T * src );§\indexc{memcpy}§6000 forall( dtype T | sized(T) ) T * memset( T * dest, char c );§\indexc{memset}§ 6001 forall( dtype T | sized(T) ) T * memcpy( T * dest, const T * src );§\indexc{memcpy}§ 6001 6002 6002 6003 // §\CFA§ safe initialization/copy array 6003 T * amemset( T dest[], char c, size_t dim ); 6004 T * amemcpy( T dest[], const T src[], size_t dim ); 6005 } 6004 forall( dtype T | sized(T) ) T * memset( T dest[], size_t dim, char c ); 6005 forall( dtype T | sized(T) ) T * memcpy( T dest[], const T src[], size_t dim ); 6006 6006 6007 6007 // §\CFA§ allocation/deallocation and constructor/destructor … … 6063 6063 forall( otype T | { int ?<?( T, T ); } ) 6064 6064 void qsort( const T * arr, size_t dim );§\indexc{qsort}§ 6065 6066 forall( otype E | { int ?<?( E, E ); } ) {6067 E * bsearch( E key, const E * vals, size_t dim );§\indexc{bsearch}§ §\C{// location}§6068 size_t bsearch( E key, const E * vals, size_t dim );§\C{// position}§6069 E * bsearchl( E key, const E * vals, size_t dim );§\indexc{bsearchl}§6070 size_t bsearchl( E key, const E * vals, size_t dim );6071 E * bsearchu( E key, const E * vals, size_t dim );§\indexc{bsearchu}§6072 size_t bsearchu( E key, const E * vals, size_t dim );6073 }6074 6075 forall( otype K, otype E | { int ?<?( K, K ); K getKey( const E & ); } ) {6076 E * bsearch( K key, const E * vals, size_t dim );6077 size_t bsearch( K key, const E * vals, size_t dim );6078 E * bsearchl( K key, const E * vals, size_t dim );6079 size_t bsearchl( K key, const E * vals, size_t dim );6080 E * bsearchu( K key, const E * vals, size_t dim );6081 size_t bsearchu( K key, const E * vals, size_t dim );6082 }6083 6084 forall( otype E | { int ?<?( E, E ); } ) {6085 void qsort( E * vals, size_t dim );§\indexc{qsort}§6086 }6087 6065 \end{cfa} 6088 6066
Note:
See TracChangeset
for help on using the changeset viewer.