Mercurial > hg > octave-nkf > gnulib-hg
comparison lib/eealloc.h @ 10074:cf0a8e173c39
Help GCC to do better code generation.
author | Bruno Haible <bruno@clisp.org> |
---|---|
date | Thu, 15 May 2008 02:01:46 +0200 |
parents | bbbbbf4cd1c5 |
children | b5e42ef33b49 |
comparison
equal
deleted
inserted
replaced
10073:0f65e1606f27 | 10074:cf0a8e173c39 |
---|---|
1 /* Memory allocation with expensive empty allocations. | 1 /* Memory allocation with expensive empty allocations. |
2 Copyright (C) 2003 Free Software Foundation, Inc. | 2 Copyright (C) 2003, 2008 Free Software Foundation, Inc. |
3 Written by Bruno Haible <bruno@clisp.org>, 2003, | 3 Written by Bruno Haible <bruno@clisp.org>, 2003, |
4 based on prior work by Jim Meyering. | 4 based on prior work by Jim Meyering. |
5 | 5 |
6 This program is free software: you can redistribute it and/or modify | 6 This program is free software: you can redistribute it and/or modify |
7 it under the terms of the GNU General Public License as published by | 7 it under the terms of the GNU General Public License as published by |
32 #include <stdlib.h> | 32 #include <stdlib.h> |
33 | 33 |
34 #if MALLOC_0_IS_NONNULL | 34 #if MALLOC_0_IS_NONNULL |
35 # define eemalloc malloc | 35 # define eemalloc malloc |
36 #else | 36 #else |
37 # if __GNUC__ >= 3 | |
38 static inline void *eemalloc (size_t n) __attribute__ ((__malloc__)); | |
39 # endif | |
37 static inline void * | 40 static inline void * |
38 eemalloc (size_t n) | 41 eemalloc (size_t n) |
39 { | 42 { |
40 /* If n is zero, allocate a 1-byte block. */ | 43 /* If n is zero, allocate a 1-byte block. */ |
41 if (n == 0) | 44 if (n == 0) |