Changes in src/tests/alloc.c [e672372:fc67d6f]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/tests/alloc.c
re672372 rfc67d6f 10 10 // Created On : Wed Feb 3 07:56:22 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Nov 24 23:06:42 201713 // Update Count : 3 1912 // Last Modified On : Mon Jan 22 21:26:40 2018 13 // Update Count : 326 14 14 // 15 15 … … 32 32 // allocation, non-array types 33 33 34 // int & r = malloc();34 // int & r = malloc(); 35 35 // r = 0xdeadbeef; 36 36 // printf( "C malloc %#x\n", r ); 37 37 // free( &r ); 38 38 39 p = (int *) (void *)malloc( sizeof(*p) );// C malloc, type unsafe39 p = (int *)malloc( sizeof(*p) ); // C malloc, type unsafe 40 40 *p = 0xdeadbeef; 41 41 printf( "C malloc %#x\n", *p ); … … 88 88 printf( "\n" ); 89 89 90 p = (int *) (void *)realloc( p, dim * sizeof(*p) );// C realloc90 p = (int *)realloc( p, dim * sizeof(*p) ); // C realloc 91 91 for ( int i = 0; i < dim; i += 1 ) { p[i] = 0xdeadbeef; } 92 92 printf( "C realloc\n" ); … … 259 259 free( p ); 260 260 261 #ifdef ERR1 261 262 stp = malloc(); 262 263 printf( "\nSHOULD FAIL\n" ); 263 #ifdef ERR1 264 p = alloc( stp, dim * sizeof( *stp) );264 p = realloc( stp, dim * sizeof( *stp ) ); 265 p = alloc( stp, dim * sizeof( *stp ) ); 265 266 p = memset( stp, 10 ); 266 267 p = memcpy( &st1, &st );
Note: See TracChangeset
for help on using the changeset viewer.