#endif
#ifdef PERL_IMPLICIT_CONTEXT
-PERLVARI(Imy_cxt_size, int, -1) /* size of PL_my_cxt_list */
+PERLVARI(Imy_cxt_size, int, 0) /* size of PL_my_cxt_list */
PERLVARI(Imy_cxt_list, void **, NULL) /* per-module array of MY_CXT pointers */
#endif
PL_exitlist = (PerlExitListEntry*)NULL;
PL_my_cxt_size = proto_perl->Imy_cxt_size;
- if (PL_my_cxt_size != -1) {
+ if (PL_my_cxt_size) {
Newx(PL_my_cxt_list, PL_my_cxt_size, void *);
Copy(proto_perl->Imy_cxt_list, PL_my_cxt_list, PL_my_cxt_size, void *);
}
}
/* make sure the array is big enough */
- if (PL_my_cxt_size < *index + 1) {
- if (PL_my_cxt_list) {
- while (PL_my_cxt_size < *index + 1)
+ if (PL_my_cxt_size <= *index) {
+ if (PL_my_cxt_size) {
+ while (PL_my_cxt_size <= *index)
PL_my_cxt_size *= 2;
Renew(PL_my_cxt_list, PL_my_cxt_size, void *);
}