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

« back to all changes in this revision

Viewing changes to erts/emulator/beam/export.c

  • 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-2010. 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
 
43
43
#define export_read_unlock()    erts_smp_rwmtx_runlock(&export_table_lock)
44
44
#define export_write_lock()     erts_smp_rwmtx_rwlock(&export_table_lock)
45
45
#define export_write_unlock()   erts_smp_rwmtx_rwunlock(&export_table_lock)
46
 
#define export_init_lock()      erts_smp_rwmtx_init(&export_table_lock, \
47
 
                                                    "export_tab")
48
46
 
49
 
extern Eterm* em_call_error_handler;
50
 
extern Uint* em_call_traced_function;
 
47
extern BeamInstr* em_call_error_handler;
 
48
extern BeamInstr* em_call_traced_function;
51
49
 
52
50
void
53
51
export_info(int to, void *to_arg)
93
91
    obj->code[2] = tmpl->code[2];
94
92
    obj->slot.index = -1;
95
93
    obj->address = obj->code+3;
96
 
    obj->code[3] = (Eterm) em_call_error_handler;
 
94
    obj->code[3] = (BeamInstr) em_call_error_handler;
97
95
    obj->code[4] = 0;
98
96
    obj->match_prog_set = NULL;
99
97
    return obj;
111
109
init_export_table(void)
112
110
{
113
111
    HashFunctions f;
114
 
 
115
 
    export_init_lock();
 
112
    erts_smp_rwmtx_opt_t rwmtx_opt = ERTS_SMP_RWMTX_OPT_DEFAULT_INITER;
 
113
    rwmtx_opt.type = ERTS_SMP_RWMTX_TYPE_FREQUENT_READ;
 
114
    rwmtx_opt.lived = ERTS_SMP_RWMTX_LONG_LIVED;
 
115
 
 
116
    erts_smp_rwmtx_init_opt(&export_table_lock, &rwmtx_opt, "export_tab");
 
117
 
116
118
    f.hash = (H_FUN) export_hash;
117
119
    f.cmp  = (HCMP_FUN) export_cmp;
118
120
    f.alloc = (HALLOC_FUN) export_alloc;
140
142
Export*
141
143
erts_find_export_entry(Eterm m, Eterm f, unsigned int a)
142
144
{
143
 
    HashValue hval = EXPORT_HASH(m, f, a);
 
145
    HashValue hval = EXPORT_HASH((BeamInstr) m, (BeamInstr) f, (BeamInstr) a);
144
146
    int ix;
145
147
    HashBucket* b;
146
148
 
185
187
 
186
188
    ep = hash_get(&export_table.htable, (void*) &e);
187
189
    if (ep != NULL && ep->address == ep->code+3 &&
188
 
        ep->code[3] != (Uint) em_call_traced_function) {
 
190
        ep->code[3] != (BeamInstr) em_call_traced_function) {
189
191
        ep = NULL;
190
192
    }
191
193
    return ep;