diff options
author | marha <marha@users.sourceforge.net> | 2013-10-02 11:13:08 +0200 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2013-10-02 11:13:08 +0200 |
commit | c3594c6c050a987fb891a1c7cf0c83102fbbec46 (patch) | |
tree | 33b215c07359fff941f32fc89a8cf3e968d334a9 /mesalib/src/glsl/ralloc.h | |
parent | 1881d1a5c46cc9efb394f84b69f58c000ee1118b (diff) | |
parent | 8092f320c341a6b3a1b428fdd4473859d5db8b79 (diff) | |
download | vcxsrv-c3594c6c050a987fb891a1c7cf0c83102fbbec46.tar.gz vcxsrv-c3594c6c050a987fb891a1c7cf0c83102fbbec46.tar.bz2 vcxsrv-c3594c6c050a987fb891a1c7cf0c83102fbbec46.zip |
Merge remote-tracking branch 'origin/released'
* origin/released:
fontconfig mesa pixman xkeyboard-config git update 2 Okt 2013
Conflicts:
mesalib/src/glsl/ast.h
mesalib/src/glsl/glsl_parser_extras.h
Diffstat (limited to 'mesalib/src/glsl/ralloc.h')
-rw-r--r-- | mesalib/src/glsl/ralloc.h | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/mesalib/src/glsl/ralloc.h b/mesalib/src/glsl/ralloc.h index 799d3a9b8..31682d515 100644 --- a/mesalib/src/glsl/ralloc.h +++ b/mesalib/src/glsl/ralloc.h @@ -404,10 +404,20 @@ bool ralloc_vasprintf_append(char **str, const char *fmt, va_list args); } /* end of extern "C" */ #endif -#define _RALLOC_OPS(ALLOC, TYPE) \ +/** + * Declare C++ new and delete operators which use ralloc. + * + * Placing this macro in the body of a class makes it possible to do: + * + * TYPE *var = new(mem_ctx) TYPE(...); + * delete var; + * + * which is more idiomatic in C++ than calling ralloc. + */ +#define DECLARE_RALLOC_CXX_OPERATORS(TYPE) \ static void* operator new(size_t size, void *mem_ctx) \ { \ - void *p = ALLOC(mem_ctx, size); \ + void *p = ralloc_size(mem_ctx, size); \ assert(p != NULL); \ return p; \ } \ @@ -417,17 +427,5 @@ bool ralloc_vasprintf_append(char **str, const char *fmt, va_list args); ralloc_free(p); \ } -/** - * Declare C++ new and delete operators which use ralloc. - * - * Placing one of these macros in the body of a class makes it possible to do: - * - * TYPE *var = new(mem_ctx) TYPE(...); - * delete var; - * - * which is more idiomatic in C++ than calling ralloc or rzalloc. - */ -#define DECLARE_RALLOC_CXX_OPERATORS(TYPE) _RALLOC_OPS(ralloc_size, TYPE) -#define DECLARE_RZALLOC_CXX_OPERATORS(TYPE) _RALLOC_OPS(rzalloc_size, TYPE) #endif |