Lumiera  0.pre.03
»edit your freedom«
vgsuppression.c
Go to the documentation of this file.
1 /*
2  vgsuppression.c - Helper program to generate valgrind suppression files
3 
4  Copyright (C)
5  2008, Christian Thaeter <ct@pipapo.org>
6 
7   **Lumiera** is free software; you can redistribute it and/or modify it
8   under the terms of the GNU General Public License as published by the
9   Free Software Foundation; either version 2 of the License, or (at your
10   option) any later version. See the file COPYING for further details.
11 */
12 
22 /*
23  just place any problematic calls where valgrind whines about in main (with comments please)
24 */
25 
26 #include "lib/tmpbuf.h"
27 #include <stdint.h>
28 
29 typedef const char* lumiera_err;
31 
33 lumiera_error_get (void);
34 
35 lumiera_err
36 lumiera_error_set (lumiera_err, const char*);
37 
38 lumiera_err
39 lumiera_error (void);
40 
41 
42 int
43 main ()
44 {
45  /* debian etch glibc is lazy about cleaning up TLS */
48 
49  /* tempbufs aren't freed by design */
50  lumiera_tmpbuf_snprintf (SIZE_MAX, "everyone loves c-strings");
51 
52  /* lumiera_error_get() mallocs a LumieraErrorcontext for each thread */
53  lumiera_error_get();
54  lumiera_error_set("dummy","dummy");
55  lumiera_error();
56 
57  return 0;
58 }
void * lumiera_tmpbuf_provide(size_t size)
Query a thread local tmpbuf.
Definition: tmpbuf.c:80
int main(int argc, const char *argv[])
run all tests or any single test specified in the first command line argument.
Definition: testrunner.cpp:37
Round robin temporary buffers.
void lumiera_tmpbuf_freeall(void)
free all buffers associated with this thread.
Definition: tmpbuf.c:64
Holding error and some context data.
Definition: error-state.c:47
lumiera_err lumiera_error_set(lumiera_err, const char *)
Set error state for the current thread.
Definition: error-state.c:96
lumiera_err lumiera_error(void)
Get and clear current error state.
Definition: error-state.c:115
char * lumiera_tmpbuf_snprintf(size_t size, const char *fmt,...)
Construct a string in a tmpbuf.
Definition: tmpbuf.c:116