Changeset a25bcf8
- Timestamp:
- Oct 13, 2022, 9:59:54 PM (2 years ago)
- Branches:
- ADT, ast-experimental, master
- Children:
- 4af5396
- Parents:
- 5951956
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tests/alloc.cfa
r5951956 ra25bcf8 10 10 // Created On : Wed Feb 3 07:56:22 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Jul 29 10:57:02202213 // Update Count : 4 3612 // Last Modified On : Thu Oct 13 21:39:34 2022 13 // Update Count : 449 14 14 // 15 15 … … 180 180 }; 181 181 182 182 ip = alloc(); 183 183 *ip = 5; 184 184 double * dp = alloc( ip`resize ); 185 185 *dp = 5.5; 186 186 S * sp = alloc( dp`resize ); 187 187 *sp = (S){ {0, 1, 2, 3, 4} }; 188 188 ip = alloc( sp`resize ); 189 189 *ip = 3; 190 190 free( ip ); 191 191 192 192 193 193 // resize, array types 194 194 195 195 ip = alloc( 5 ); 196 196 for ( i; 5 ) { ip[i] = 5; } 197 197 dp = alloc( 5, ip`resize ); 198 198 for ( i; 5 ) { dp[i] = 5.5; } 199 199 sp = alloc( 5, dp`resize ); 200 200 for ( i; 5 ) { sp[i] = (S){ {0, 1, 2, 3, 4} }; } 201 201 ip = alloc( 3, sp`resize ); 202 202 for ( i; 3 ) { ip[i] = 3; } 203 203 ip = alloc( 7, ip`realloc ); 204 204 for ( i; 7 ) { ip[i] = 7; } 205 205 ip = alloc( 7, ip`resize ); 206 206 for ( i; 7 ) { ip[i] = 7; } 207 207 free( ip ); 208 208 209 209 … … 217 217 const_count++; 218 218 } 219 void ^?{}( Struct & a ) { 219 void ^?{}( Struct & a ) { dest_count++; } // destruct 220 220 Struct st, st1, sta[dim], sta1[dim], * stp, * stp1; 221 221
Note: See TracChangeset
for help on using the changeset viewer.