~ubuntu-branches/ubuntu/edgy/libapache2-mod-perl2/edgy

« back to all changes in this revision

Viewing changes to src/modules/perl/modperl_perl_includes.h

  • Committer: Bazaar Package Importer
  • Author(s): Andres Salomon
  • Date: 2005-08-12 01:40:38 UTC
  • mfrom: (1.1.2 upstream) (2.1.1 sarge)
  • Revision ID: james.westby@ubuntu.com-20050812014038-gjigefs55pqx4qc8
Tags: 2.0.1-3
Grr.  Really include perl.conf file; it got lost due to diff not
wanting to add an empty file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Copyright 2001-2004 The Apache Software Foundation
 
1
/* Copyright 2001-2005 The Apache Software Foundation
2
2
 *
3
3
 * Licensed under the Apache License, Version 2.0 (the "License");
4
4
 * you may not use this file except in compliance with the License.
103
103
#   define PERL_MAGIC_tied 'P'
104
104
#endif
105
105
 
 
106
#ifndef PERL_MAGIC_tiedscalar
 
107
#   define PERL_MAGIC_tiedscalar 'q'
 
108
#endif
 
109
 
106
110
#ifndef PERL_MAGIC_ext
107
111
#   define PERL_MAGIC_ext '~'
108
112
#endif
112
116
#   define environ (*_NSGetEnviron())
113
117
#endif
114
118
 
 
119
/* sv_copypv was added in perl 5.7.3 */
 
120
#ifndef sv_copypv
 
121
#  define sv_copypv(dsv, ssv)     \
 
122
    STMT_START {                  \
 
123
        STRLEN len;               \
 
124
        char *s;                  \
 
125
        s = SvPV(ssv, len);       \
 
126
        sv_setpvn(dsv, s, len);   \
 
127
        if (SvUTF8(ssv)) {        \
 
128
            SvUTF8_on(dsv);       \
 
129
        }                         \
 
130
        else {                    \
 
131
            SvUTF8_off(dsv);      \
 
132
        }                         \
 
133
    } STMT_END
 
134
#endif
 
135
 
 
136
 
 
137
/* perl bug workaround: with USE_ITHREADS perl leaks pthread_key_t on
 
138
 * every reload of libperl.{a,so} (it's allocated on the very first
 
139
 * perl_alloc() and never freed). This becomes a problem on apache
 
140
 * restart: if the OS limit is 1024, 1024 restarts later things will
 
141
 * start crashing */
 
142
/* XXX: once and if it's fixed in perl, we need to disable it for the
 
143
 * versions that have it fixed, otherwise it'll crash because it'll be
 
144
 * freed twice */
 
145
#ifdef USE_ITHREADS
 
146
#define MP_PERL_FREE_THREAD_KEY_WORKAROUND      \
 
147
    if (PL_curinterp) {                         \
 
148
        FREE_THREAD_KEY;                        \
 
149
        PL_curinterp = NULL;                    \
 
150
    }
 
151
#else
 
152
#define MP_PERL_FREE_THREAD_KEY_WORKAROUND
 
153
#endif
 
154
 
115
155
#endif /* MODPERL_PERL_INCLUDES_H */