- Timestamp:
- Jun 2, 2020, 11:37:23 AM (4 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 04b4a71
- Parents:
- 3d46f01
- Location:
- libcfa/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/heap.hfa
r3d46f01 r4e7c0fc0 10 10 // Created On : Tue May 26 11:23:55 2020 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue May 26 18:13:56202013 // Update Count : 712 // Last Modified On : Mon Jun 1 21:19:00 2020 13 // Update Count : 10 14 14 // 15 15 … … 36 36 void * amemalign( size_t align, size_t dim, size_t elemSize ); 37 37 void * cmemalign( size_t align, size_t noOfElems, size_t elemSize ); 38 size_t malloc_alignment( void * addr ); 39 bool malloc_zero_fill( void * addr ); 38 40 size_t malloc_size( void * addr ); 39 size_t malloc_alignment( void * addr ); 40 bool malloc_zero_fill( void * ); 41 size_t malloc_usable_size( void * addr ); 41 42 int malloc_stats_fd( int fd ); 42 43 } // extern "C" -
libcfa/src/stdlib.cfa
r3d46f01 r4e7c0fc0 10 10 // Created On : Thu Jan 28 17:10:29 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : T hu Apr 16 22:43:33202013 // Update Count : 49 812 // Last Modified On : Tue Jun 2 08:44:46 2020 13 // Update Count : 499 14 14 // 15 15 … … 277 277 extern "C" { // override C version 278 278 void srandom( unsigned int seed ) { srand48( (long int)seed ); } 279 long int random( void ) { return mrand48(); } 279 long int random( void ) { return mrand48(); } // GENERATES POSITIVE AND NEGATIVE VALUES 280 280 } // extern "C" 281 281 -
libcfa/src/stdlib.hfa
r3d46f01 r4e7c0fc0 10 10 // Created On : Thu Jan 28 17:12:35 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue May 26 22:50:08202013 // Update Count : 4 3912 // Last Modified On : Tue Jun 2 09:05:16 2020 13 // Update Count : 450 14 14 // 15 15 … … 19 19 #include "bits/align.hfa" 20 20 21 #include <malloc.h>22 21 #include <stdlib.h> // *alloc, strto*, ato* 22 #include <heap.hfa> 23 23 24 24 // Reduce includes by explicitly defining these routines. 25 25 extern "C" { 26 void * memalign( size_t alignment, size_t size ); // malloc.h 27 void * pvalloc( size_t size ); // malloc.h 26 28 void * memset( void * dest, int fill, size_t size ); // string.h 27 29 void * memcpy( void * dest, const void * src, size_t size ); // string.h … … 299 301 extern "C" { // override C version 300 302 void srandom( unsigned int seed ); 301 long int random( void ); 303 long int random( void ); // GENERATES POSITIVE AND NEGATIVE VALUES 304 // For positive values, use unsigned int, e.g., unsigned int r = random() % 100U; 302 305 } // extern "C" 303 306 … … 306 309 long int random( long int u ) { if ( u < 0 ) return random( u, 0 ); else return random( 0, u ); } // [0,u) 307 310 unsigned long int random( void ) { return lrand48(); } 311 unsigned long int random( unsigned long int u ) { return lrand48() % u; } // [0,u) 308 312 unsigned long int random( unsigned long int l, unsigned long int u ) { if ( u < l ) [u, l] = [l, u]; return lrand48() % (u - l) + l; } // [l,u) 309 unsigned long int random( unsigned long int u ) { return lrand48() % u; } // [0,u)310 313 311 314 char random( void ) { return (unsigned long int)random(); }
Note: See TracChangeset
for help on using the changeset viewer.