function libbenchmark_pal_print_string

From liblfds.org
Jump to navigation Jump to search

Source Files

└───test_and_benchmark
    └───libbenchmark
        ├───inc
        │   └───libbenchmark
        │           libbenchmark_porting_abstraction_layer.h
        └───src
            └───libbenchmark_porting_abstraction_layer
                    libbenchmark_porting_abstraction_layer_print_string.c

Prototype

void libbenchmark_pal_print_string( char const * const string );

Parameters

char const * const string

A string emitted by libbenchmark.

Return Value

No return value.

Example

void libbenchmark_pal_print_string( char const * const string )
{
  LFDS710_PAL_ASSERT( string != NULL );

  printf( "%s", string );

  fflush( stdout );

  return;
}

Notes

The benchmarksuite can take a considerable time to complete. As such, libbenchmark emits results as they are generated in the form of strings. Note such strings as often not newline terminated, and so buffered outputs will need to flush. Platforms vary in how they can (or cannot) display strings. As such, the library calls this function. The abstraction layer is then free to act as it will. On hosted user-mode implementations, the string is emitted to stdout.

See Also