~ubuntu-branches/ubuntu/trusty/erlang/trusty

« back to all changes in this revision

Viewing changes to erts/emulator/beam/big.h

  • Committer: Bazaar Package Importer
  • Author(s): Clint Byrum
  • Date: 2011-05-05 15:48:43 UTC
  • mfrom: (3.5.13 sid)
  • Revision ID: james.westby@ubuntu.com-20110505154843-0om6ekzg6m7ugj27
Tags: 1:14.b.2-dfsg-3ubuntu1
* Merge from debian unstable.  Remaining changes:
  - Drop libwxgtk2.8-dev build dependency. Wx isn't in main, and not
    supposed to.
  - Drop erlang-wx binary.
  - Drop erlang-wx dependency from -megaco, -common-test, and -reltool, they
    do not really need wx. Also drop it from -debugger; the GUI needs wx,
    but it apparently has CLI bits as well, and is also needed by -megaco,
    so let's keep the package for now.
  - debian/patches/series: Do what I meant, and enable build-options.patch
    instead.
* Additional changes:
  - Drop erlang-wx from -et
* Dropped Changes:
  - patches/pcre-crash.patch: CVE-2008-2371: outer level option with
    alternatives caused crash. (Applied Upstream)
  - fix for ssl certificate verification in newSSL: 
    ssl_cacertfile_fix.patch (Applied Upstream)
  - debian/patches/series: Enable native.patch again, to get stripped beam
    files and reduce the package size again. (build-options is what
    actually accomplished this)
  - Remove build-options.patch on advice from upstream and because it caused
    odd build failures.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
 * %CopyrightBegin%
3
 
 * 
4
 
 * Copyright Ericsson AB 1996-2009. All Rights Reserved.
5
 
 * 
 
3
 *
 
4
 * Copyright Ericsson AB 1996-2011. All Rights Reserved.
 
5
 *
6
6
 * The contents of this file are subject to the Erlang Public License,
7
7
 * Version 1.1, (the "License"); you may not use this file except in
8
8
 * compliance with the License. You should have received a copy of the
9
9
 * Erlang Public License along with this software. If not, it can be
10
10
 * retrieved online at http://www.erlang.org/.
11
 
 * 
 
11
 *
12
12
 * Software distributed under the License is distributed on an "AS IS"
13
13
 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
14
14
 * the License for the specific language governing rights and limitations
15
15
 * under the License.
16
 
 * 
 
16
 *
17
17
 * %CopyrightEnd%
18
18
 */
19
19
 
34
34
 
35
35
typedef Uint     ErtsDigit;
36
36
 
37
 
#if (SIZEOF_VOID_P == 4) && defined(SIZEOF_LONG_LONG) && (SIZEOF_LONG_LONG == 8)
 
37
#if ((SIZEOF_VOID_P == 4) || HALFWORD_HEAP) && defined(SIZEOF_LONG_LONG) && (SIZEOF_LONG_LONG == 8)
38
38
/* Assume 32-bit machine with long long support */
39
39
typedef Uint64   ErtsDoubleDigit;
40
40
typedef Uint16   ErtsHalfDigit;
58
58
 
59
59
typedef Uint  dsize_t;   /* Vector size type */
60
60
 
61
 
#define D_EXP (SIZEOF_VOID_P*8)
 
61
#define D_EXP (ERTS_SIZEOF_ETERM*8)
62
62
#define D_MASK     ((ErtsDigit)(-1))      /* D_BASE-1 */
63
63
 
64
64
/* macros for bignum objects */
88
88
 
89
89
#define BIG_UINT_HEAP_SIZE (1 + 1)      /* always, since sizeof(Uint) <= sizeof(Eterm) */
90
90
 
91
 
#ifdef ARCH_32
 
91
#if HALFWORD_HEAP
 
92
#define BIG_UWORD_HEAP_SIZE(UW) (((UW) >> (sizeof(Uint) * 8)) ? 3 : 2)
 
93
#else
 
94
#define BIG_UWORD_HEAP_SIZE(UW) BIG_UINT_HEAP_SIZE
 
95
#endif
 
96
 
 
97
#if defined(ARCH_32) || HALFWORD_HEAP
92
98
 
93
99
#define ERTS_UINT64_BIG_HEAP_SIZE__(X) \
94
100
  ((X) >= (((Uint64) 1) << 32) ? (1 + 2) : (1 + 1))
114
120
 
115
121
Eterm small_times(Sint, Sint, Eterm*);
116
122
 
117
 
Eterm big_plus(Eterm, Eterm, Eterm*);
 
123
Eterm big_plus(Wterm, Wterm, Eterm*);
118
124
Eterm big_minus(Eterm, Eterm, Eterm*);
119
125
Eterm big_times(Eterm, Eterm, Eterm*);
120
126
Eterm big_div(Eterm, Eterm, Eterm*);
131
137
Eterm big_bnot(Eterm, Eterm*);
132
138
 
133
139
Eterm big_lshift(Eterm, Sint, Eterm*);
134
 
int big_comp (Eterm, Eterm);
 
140
int big_comp (Wterm, Wterm);
135
141
int big_ucomp (Eterm, Eterm);
136
 
int big_to_double(Eterm x, double* resp);
 
142
int big_to_double(Wterm x, double* resp);
137
143
Eterm small_to_big(Sint, Eterm*);
138
144
Eterm uint_to_big(Uint, Eterm*);
 
145
Eterm uword_to_big(UWord, Eterm*);
139
146
Eterm erts_make_integer(Uint, Process *);
140
147
 
141
148
dsize_t big_bytes(Eterm);
143
150
byte* big_to_bytes(Eterm, byte*);
144
151
 
145
152
int term_to_Uint(Eterm, Uint*);
 
153
int term_to_UWord(Eterm, UWord*);
146
154
int term_to_Sint(Eterm, Sint*);
 
155
#if HAVE_INT64
 
156
int term_to_Uint64(Eterm, Uint64*);
 
157
int term_to_Sint64(Eterm, Sint64*);
 
158
#endif
147
159
 
148
160
Uint32 big_to_uint32(Eterm b);
149
161
int term_equals_2pow32(Eterm);