~ubuntu-branches/ubuntu/karmic/gnustep-base/karmic

« back to all changes in this revision

Viewing changes to Source/numbers.c

  • Committer: Bazaar Package Importer
  • Author(s): Eric Heintzmann
  • Date: 2005-04-17 00:14:38 UTC
  • mfrom: (1.2.1 upstream) (2.1.2 hoary)
  • Revision ID: james.westby@ubuntu.com-20050417001438-enf0y07c9tku85z1
Tags: 1.10.3-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Structure counters and functions for getting at them.
2
 
 * Copyright (C) 1995, 1996  Free Software Foundation, Inc.
3
 
 * 
4
 
 * Author: Albin L. Jones <Albin.L.Jones@Dartmouth.EDU>
5
 
 * Created: Sun Dec  3 00:23:13 EST 1995
6
 
 * Updated: Mon Mar 11 02:40:00 EST 1996
7
 
 * Serial: 96.03.11.03
8
 
 * 
9
 
 * This file is part of the GNUstep Base Library.
10
 
 * 
11
 
 * This library is free software; you can redistribute it and/or
12
 
 * modify it under the terms of the GNU Library General Public
13
 
 * License as published by the Free Software Foundation; either
14
 
 * version 2 of the License, or (at your option) any later version.
15
 
 * 
16
 
 * This library is distributed in the hope that it will be useful,
17
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
19
 
 * Library General Public License for more details.
20
 
 * 
21
 
 * You should have received a copy of the GNU Library General Public
22
 
 * License along with this library; if not, write to the Free
23
 
 * Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.  */ 
24
 
 
25
 
/**** Included Headers *******************************************************/
26
 
 
27
 
#include <base/numbers.h>
28
 
 
29
 
/**** Type, Constant, and Macro Definitions **********************************/
30
 
 
31
 
size_t ___o_number_allocated = 0;
32
 
size_t ___o_number_deallocated = 0;
33
 
size_t ___o_number_serialized = 0;
34
 
 
35
 
/**** Function Implementations ***********************************************/
36
 
 
37
 
/* Returns the number of Libobjects structures allocated. */
38
 
size_t
39
 
_o_number_allocated(void)
40
 
{
41
 
  return ___o_number_allocated;
42
 
}
43
 
 
44
 
/* Returns the number of Libobjects structures deallocated. */
45
 
size_t
46
 
_o_number_deallocated(void)
47
 
{
48
 
  return ___o_number_deallocated;
49
 
}
50
 
 
51
 
/* Returns the next serial number to be handed out. */
52
 
size_t
53
 
_o_number_serialized(void)
54
 
{
55
 
  return ___o_number_serialized;
56
 
}
57
 
 
58
 
size_t
59
 
_o_next_power_of_two(size_t bound)
60
 
{
61
 
  size_t start = 1;
62
 
  while ((start <= bound) && (start <<= 1));
63
 
  return start;
64
 
}