[Openais] [PATCH 1/2] flight recorder: switch from int to bytes for requested allocation
Fabio M. Di Nitto
fdinitto at redhat.com
Thu Jun 18 05:55:24 PDT 2009
The flight recoder buffer size as specified in LOGSYS_DECLARE_SYSTEM
or _logsys_rec_init was expressed in number of ints. A developer asking
to allocate 512K would get a 2M allocation on a machine with sizeof(int) = 4.
This is confusing and the patch addresses it:
- rename rec_size to fltsize for external API (no type change),
because rec_size is used many times internally for other reasons
and it can be confusing.
- rename size to fltsize in _logsys_rec_init.
- document what we allocate and why.
- swap comments around to match the code.
- introduce a simple macro to perform rounding (stolen from linux-2.6.git).
Signed-off-by: Fabio M. Di Nitto <fdinitto at redhat.com>
:100644 100644 90efdf8... 904e631... M exec/logsys.c
:100644 100644 b34b327... 19e5dae... M include/corosync/engine/logsys.h
:100644 100644 e19836e... 6017f10... M man/logsys_overview.8
exec/logsys.c | 31 ++++++++++++++++++++++++++-----
include/corosync/engine/logsys.h | 4 ++--
man/logsys_overview.8 | 5 +++--
3 files changed, 31 insertions(+), 9 deletions(-)
--
1.5.4.3
More information about the Openais
mailing list