Changes in / [9617533:447b0d2b]


Ignore:
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • doc/man/cfa.1

    r9617533 r447b0d2b  
    1111.\" Created On       : Wed Jul 26 22:34:47 2017
    1212.\" Last Modified By : Peter A. Buhr
    13 .\" Last Modified On : Wed Sep  2 17:59:53 2020
    14 .\" Update Count     : 78
     13.\" Last Modified On : Thu Jul 27 10:29:29 2017
     14.\" Update Count     : 44
    1515.\"
    1616.\" nroff -man cfa.1
     
    2323.ds Cf "Cforall
    2424.\"
    25 .TH CFA 1 "2020-09-2" cfa-\*(Mg "\*(Cf Project"
     25.TH cfa 1 2017-07-27 cfa-\*(Mg
    2626.SH NAME
    27 cfa \- \*(Cf project translator and runtime library to enhance C
     27cfa \- \*(Cf Translator and Runtime Library
    2828.SH SYNOPSIS
    29 cfa [cfa/gcc-options]
    30     [cfa/c source-files]
    31     [assembler/loader files]
     29cfa [gcc-options] [C/\*(Cf source-files] [assembler/loader files]
    3230.SH DESCRIPTION
    33 \*(Cf (C-for-all) is an open-source project extending ISO C with modern safety and productivity features, while still ensuring backwards compatibility with C and its programmers.
    34 
    3531The cfa command compiles C and \*(Cf source files and links C/\*(Cf object
    3632files named on the command line.
     
    3834The cfa command introduces a translator pass over the specified source files
    3935after the C preprocessor but before the C compilation.  The translator converts
    40 new \*(Cf constructs into C statements.  The cfa command also provides a fully
    41 concurrent (user-level threads) runtime library, which is linked with the
    42 \*(Cf application.
     36new \*(Cf constructs into C statements.  The cfa command also provides the
     37runtime library, which is linked with each \*(Cf application.
    4338
    4439The command line options depend on the particular C compiler used (gcc/clang
    4540supported).  As with most C compilers, the output is sent to the file a.out(5)
    4641unless the -o option is present on the command line.  See the reference pages
    47 for gcc(1) for more information on command line options.
     42for gcc(1) for more information.
    4843.SH OPTIONS
    4944When multiple conflicting options appear on the command line, e.g.,
     
    5550All of the options available to the gcc compiler are available to the cfa
    5651translator.  The following gcc flags are implicitly turned on:
    57 .IP "-std=gnu11" 3
    58 The 2011 C standard plus GNU extensions.
    59 .IP "-fgnu89-inline"
    60 Use the traditional GNU semantics for inline routines in C11 mode, which allows inline routines in header files.
    61 .IP "-imacros stdbool.h"
    62 Include stdbool.h to get defines for bool/true/false.
    63 .IP "-latomic -lm"
    64 Provide access to double-wide CAS instruction and math library.
     52.IP -std=gnu99 3
     53The 1999 C standard plus GNU extensions.
     54.IP -fgnu89-inline
     55Use the traditional GNU semantics for inline routines in C99 mode, which allows inline routines in header files.
    6556.LP
    6657The following additional options are available:
    67 .IP "-CFA" 3
     58.IP -CFA 3
    6859Only the C preprocessor and the \*(Cf translator steps are performed and the transformed program is written to standard output, which makes it possible to examine the code generated by the \*(Cf translator.
    6960The generated code starts with the standard \*(Cf prelude.
    70 .IP "-debug"
     61.IP -debug
    7162The program is linked with the debugging version of the runtime system.
    7263The debug version performs runtime checks to help during the debugging phase of a \*(Cf program, but can substantially slow program execution.
    7364The runtime checks should only be removed after the program is completely debugged.
    7465.B This option is the default.
    75 .IP "-nodebug"
     66.IP -nodebug
    7667The program is linked with the non-debugging version of the runtime system, so the execution of the program is faster.
    7768.I However, no runtime checks or asserts are performed so errors usually result in abnormal program behaviour or termination.
    78 .IP "-help"
     69.IP -help
    7970Information about the set of \*(Cf compilation flags is printed.
    80 .IP "-nohelp"
     71.IP -nohelp
    8172Information about the set of \*(Cf compilation flags is not printed.
    8273.B This option is the default.
    83 .IP "-quiet"
     74.IP -quiet
    8475The \*(Cf compilation message is not printed at the beginning of a compilation.
    85 .IP "-noquiet"
     76.IP -noquiet
    8677The \*(Cf compilation message is printed at the beginning of a compilation.
    8778.B This option is the default.
     
    9081available.  These variables allow conditional compilation of programs that must
    9182work differently in these situations.
    92 .IP "__CFA_MAJOR__" 3
     83.IP __CFA_MAJOR__ 3
    9384is available during preprocessing and its value is the major version number of \*(Cf.
    94 .IP "__CFA_MINOR__"
     85.IP __CFA_MINOR__
    9586is available during preprocessing and its value is the minor version number of \*(Cf.
    96 .IP "__CFA_PATCH__"
     87.IP __CFA_PATCH__
    9788is available during preprocessing and its value is the patch level number of \*(Cf.
    9889.IP "__CFA__, __CFORALL__, and __cforall"
    9990are always available during preprocessing and have no value.
    100 .IP "__CFA_DEBUG__"
     91.IP __CFA_DEBUG__
    10192is available during preprocessing if the -debug compilation option is
    10293specified.
     
    125116.SH REFERENCES
    126117.HP 3
    127 .I \*(Cf Home Page
     118\*(Cf Reference and Rational Manual
    128119.br
    129 https://cforall.uwaterloo.ca
     120http://plg.uwaterloo.ca/~cforall/refrat.pdf
    130121.HP
    131122.I \*(Cf User Manual
    132123.br
    133 https://cforall.uwaterloo.ca/doc/user.pdf
    134 .SH BUILDS
    135 Nightly builds are available here https://cforall.uwaterloo.ca/jenkins
     124http://plg.uwaterloo.ca/~cforall/user.pdf
    136125.SH BUGS
    137 Bugs reportss are available here https://cforall.uwaterloo.ca/trac
     126Bugs should be reported to trac@plg.cs.uwaterloo.ca.
    138127.SH COPYRIGHT
    139128\*(Cf is covered under the licence agreement in the distribution.
    140129.SH AUTHORS
    141130Andrew Beach, Richard Bilson, Peter A. Buhr, Thierry Delisle, Glen Ditchfield,
    142 Rodolfo G. Esteves, Aaron Moss, Rob Schluntz, Mubeen Zulfiqar
     131Rodolfo G. Esteves, Aaron Moss, Rob Schluntz
  • driver/cfa.cc

    r9617533 r447b0d2b  
    1010// Created On       : Tue Aug 20 13:44:49 2002
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Sep  2 17:59:20 2020
    13 // Update Count     : 438
     12// Last Modified On : Thu Aug 20 23:43:59 2020
     13// Update Count     : 436
    1414//
    1515
     
    437437                #endif // __x86_64__
    438438                args[nargs++] = "-ldl";
     439                args[nargs++] = "-lrt";
    439440                args[nargs++] = "-lm";
    440441        } // if
  • libcfa/src/heap.cfa

    r9617533 r447b0d2b  
    1010// Created On       : Tue Dec 19 21:58:35 2017
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Sep  3 16:22:54 2020
    13 // Update Count     : 943
     12// Last Modified On : Tue Sep  1 21:58:36 2020
     13// Update Count     : 927
    1414//
    1515
     
    2929#include "math.hfa"                                                                             // ceiling
    3030#include "bitmanip.hfa"                                                                 // is_pow2, ceiling2
     31
     32#define MIN(x, y) (y > x ? x : y)
    3133
    3234static bool traceHeap = false;
     
    954956
    955957                headers( "realloc", naddr, header, freeElem, bsize, oalign );
    956                 memcpy( naddr, oaddr, min( osize, size ) );             // copy bytes
     958                memcpy( naddr, oaddr, MIN( osize, size ) );             // copy bytes
    957959                free( oaddr );
    958960
     
    12311233        } // if
    12321234
    1233         // Attempt to reuse existing storage.
    1234         HeapManager.Storage.Header * header = headerAddr( oaddr );
    1235         if ( header->kind.fake.alignment & 1 == 1 ) {           // old fake header ?
    1236                 if ( unlikely( (uintptr_t)oaddr % nalign == 0) && // lucky match ?
    1237                          header->kind.fake.alignment <= nalign &&       // ok to leave LSB at 1
    1238                          nalign <= 128 ) {                                                      // not too much alignment storage wasted ?
    1239 
    1240                         HeapManager.FreeHeader * freeElem;
    1241                         size_t bsize, oalign;
    1242                         headers( "resize", oaddr, header, freeElem, bsize, oalign );
    1243                         size_t odsize = dataStorage( bsize, oaddr, header ); // data storage available in bucket
    1244 
    1245                         if ( size <= odsize && odsize <= size * 2 ) { // allow 50% wasted data storage
    1246                                 headerAddr( oaddr )->kind.fake.alignment = nalign | 1; // update alignment (could be the same)
    1247 
    1248                                 header->kind.real.blockSize &= -2;              // turn off 0 fill
    1249                                 header->kind.real.size = size;                  // reset allocation size
    1250                                 return oaddr;
    1251                         } // if
    1252                 } // if
    1253         } else {                                                                                        // no old fake header
    1254                 if ( nalign == libAlign() ) {                                   // no new fake header needed => try to reuse storage
    1255                         HeapManager.FreeHeader * freeElem;
    1256                         size_t bsize, oalign;
    1257                         headers( "resize", oaddr, header, freeElem, bsize, oalign );
    1258                         size_t odsize = dataStorage( bsize, oaddr, header ); // data storage available in bucket
    1259 
    1260                         if ( size <= odsize && odsize <= size * 2 ) { // allow 50% wasted data storage
    1261                                 header->kind.real.blockSize &= -2;              // turn off 0 fill
    1262                                 header->kind.real.size = size;                  // reset allocation size
    1263                                 return oaddr;
    1264                         } // if
     1235        HeapManager.Storage.Header * header;
     1236        HeapManager.FreeHeader * freeElem;
     1237        size_t bsize, oalign;
     1238        headers( "resize", oaddr, header, freeElem, bsize, oalign );
     1239        size_t odsize = dataStorage( bsize, oaddr, header ); // data storage available in bucket
     1240
     1241        if ( oalign == nalign && size <= odsize && odsize <= size * 2 ) { // <= alignment and new alignment are same, allow 50% wasted storage for smaller size
     1242                header->kind.real.blockSize &= -2;                      // turn off 0 fill
     1243                header->kind.real.size = size;                          // reset allocation size
     1244                return oaddr;
     1245        } // if
     1246        if ( oalign < nalign && (uintptr_t)oaddr % nalign == 0 && oalign > libAlign() ) { // <= alignment and new alignment happens to match, and oaddr has a fake header
     1247                headerAddr( oaddr )->kind.fake.alignment = nalign | 1; // update alignment (could be the same)
     1248                if ( size <= odsize && odsize <= size * 2 ) {   // allow 50% wasted storage for smaller size
     1249                        header->kind.real.blockSize &= -2;                      // turn off 0 fill
     1250                        header->kind.real.size = size;                          // reset allocation size
     1251                        return oaddr;
    12651252                } // if
    12661253        } // if
     
    13191306
    13201307        headers( "realloc", naddr, header, freeElem, bsize, oalign );
    1321         memcpy( naddr, oaddr, min( osize, size ) );                     // copy bytes
     1308        memcpy( naddr, oaddr, MIN( osize, size ) );                     // copy bytes
    13221309        free( oaddr );
    13231310
Note: See TracChangeset for help on using the changeset viewer.