Changeset 3849857
- Timestamp:
- Apr 12, 2016, 6:35:18 PM (9 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, string, with_gc
- Children:
- 45161b4d, aa19ccf
- Parents:
- b52d900
- Location:
- src/libcfa
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/libcfa/iostream
rb52d900 r3849857 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue Apr 5 22:32:37201613 // Update Count : 9 012 // Last Modified On : Sun Apr 10 23:00:12 2016 13 // Update Count : 92 14 14 // 15 15 … … 20 20 21 21 trait ostream( dtype ostype ) { 22 _Bool sepPrt( ostype * ); 23 void sepOn( ostype * ); 24 void sepOff( ostype * ); 25 void sepReset( ostype * ); 26 void sepReset( ostype *, _Bool ); 27 void sepSet( ostype *, const char * ); 28 const char * sepGet( ostype * ); 29 _Bool sepDisable( ostype * ); 30 _Bool sepEnable( ostype * ); 22 _Bool sepPrt( ostype * ); // return separator state (on/off) 23 void sepOn( ostype * ); // turn separator state on 24 void sepOff( ostype * ); // turn separator state off 25 void sepReset( ostype * ); // set separator state to default state 26 void sepReset( ostype *, _Bool ); // set separator and default state 27 void sepSet( ostype *, const char * ); // set separator to string (15 character maximum) 28 const char * sepGet( ostype * ); // get separator string 29 _Bool sepDisable( ostype * ); // set default state to off, and return previous state 30 _Bool sepEnable( ostype * ); // set default state to on, and return previous state 31 31 32 int fail( ostype * ); 32 33 int flush( ostype * ); -
src/libcfa/stdlib
rb52d900 r3849857 10 10 // Created On : Thu Jan 28 17:12:35 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Apr 1 22:26:14 201613 // Update Count : 7 312 // Last Modified On : Tue Apr 12 18:22:54 2016 13 // Update Count : 77 14 14 // 15 15 … … 22 22 23 23 forall( otype T ) T * malloc( void ); 24 extern "C" { 25 void * malloc( size_t ); // use default C for void * 26 } // extern "C" 27 forall( otype T ) T * malloc( size_t size ); 24 28 forall( otype T ) T * malloc( char fill ); 25 29 forall( otype T ) T * malloc( T * ptr, size_t size ); -
src/libcfa/stdlib.c
rb52d900 r3849857 10 10 // Created On : Thu Jan 28 17:10:29 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Mar 30 10:48:41201613 // Update Count : 1 4912 // Last Modified On : Tue Apr 12 18:19:22 2016 13 // Update Count : 151 14 14 // 15 15 … … 28 28 29 29 forall( otype T ) T * malloc( void ) { 30 printf( "malloc1\n" );30 //printf( "malloc1\n" ); 31 31 return (T *)malloc( sizeof(T) ); 32 32 } // malloc 33 33 forall( otype T ) T * malloc( size_t size ) { 34 printf( "malloc2\n" );34 //printf( "malloc2\n" ); 35 35 return (T *)(void *)malloc( size ); 36 36 } // malloc 37 37 forall( otype T ) T * malloc( char fill ) { 38 printf( "malloc3\n" );38 //printf( "malloc3\n" ); 39 39 T * ptr = (T *)malloc( sizeof(T) ); 40 40 return memset( ptr ); … … 42 42 43 43 forall( otype T ) T * calloc( size_t size ) { 44 printf( "calloc\n" );44 //printf( "calloc\n" ); 45 45 return (T *)calloc( size, sizeof(T) ); 46 46 } // calloc 47 47 48 48 forall( otype T ) T * realloc( T * ptr, size_t size ) { 49 printf( "realloc1\n" );49 //printf( "realloc1\n" ); 50 50 return (T *)(void *)realloc( (void *)ptr, size ); 51 51 } // realloc 52 52 forall( otype T ) T * realloc( T * ptr, size_t size, unsigned char fill ) { 53 printf( "realloc2\n" );53 //printf( "realloc2\n" ); 54 54 char * nptr = (T *)(void *)realloc( (void *)ptr, size ); 55 55 size_t unused = malloc_usable_size( nptr ); … … 59 59 60 60 forall( otype T ) T * malloc( T * ptr, size_t size ) { 61 printf( "malloc4\n" );61 //printf( "malloc4\n" ); 62 62 return (T *)realloc( ptr, size ); 63 63 } // malloc 64 64 forall( otype T ) T * malloc( T * ptr, size_t size, unsigned char fill ) { 65 printf( "malloc5\n" );65 //printf( "malloc5\n" ); 66 66 return (T *)realloc( ptr, size, fill ); 67 67 } // malloc 68 68 69 69 forall( otype T ) T * aligned_alloc( size_t alignment ) { 70 printf( "aligned_alloc\n" );70 //printf( "aligned_alloc\n" ); 71 71 return (T *)memalign( alignment, sizeof(T) ); 72 72 } // aligned_alloc 73 73 74 74 forall( otype T ) T * memalign( size_t alignment ) { 75 printf( "memalign\n" );75 //printf( "memalign\n" ); 76 76 return (T *)memalign( alignment, sizeof(T) ); 77 77 } // memalign 78 78 79 79 forall( otype T ) int posix_memalign( T ** ptr, size_t alignment ) { 80 printf( "posix_memalign\n" );80 //printf( "posix_memalign\n" ); 81 81 return posix_memalign( (void **)ptr, alignment, sizeof(T) ); 82 82 } // posix_memalign 83 83 84 84 forall( otype T ) T * memset( T * ptr, unsigned char fill ) { // use default value '\0' for fill 85 printf( "memset1\n" );85 //printf( "memset1\n" ); 86 86 return (T *)memset( ptr, (int)fill, malloc_usable_size( ptr ) ); 87 87 } // memset 88 88 forall( otype T ) T * memset( T * ptr ) { // remove when default value available 89 printf( "memset2\n" );89 //printf( "memset2\n" ); 90 90 return (T *)memset( ptr, 0, malloc_usable_size( ptr ) ); 91 91 } // memset
Note: See TracChangeset
for help on using the changeset viewer.