diff options
-rw-r--r-- | NetWare/nwperlsys.c | 6 | ||||
-rw-r--r-- | cop.h | 29 | ||||
-rw-r--r-- | iperlsys.h | 20 | ||||
-rw-r--r-- | op.c | 10 |
4 files changed, 54 insertions, 11 deletions
diff --git a/NetWare/nwperlsys.c b/NetWare/nwperlsys.c index 4fc65d31f0..9eca5225f7 100644 --- a/NetWare/nwperlsys.c +++ b/NetWare/nwperlsys.c @@ -87,9 +87,8 @@ perl_alloc(void) WCValHashTable<void*>* m_allocList; m_allocList = new WCValHashTable<void*> (fnAllocListHash, 256); fnInsertHashListAddrs(m_allocList, FALSE); - my_perl = perl_alloc_using(&perlMem, - NULL, + &perlMem, NULL, &perlEnv, &perlStdIO, @@ -169,9 +168,8 @@ perl_alloc_override(struct IPerlMem** ppMem, struct IPerlMem** ppMemShared, lpProc=&perlProc; else lpProc=*ppProc; - my_perl = perl_alloc_using(lpMem, - NULL, + lpMem, NULL, lpEnv, lpStdio, @@ -30,13 +30,25 @@ struct cop { # define CopFILE(c) ((c)->cop_file) # define CopFILEGV(c) (CopFILE(c) \ ? gv_fetchfile(CopFILE(c)) : Nullgv) -# define CopFILE_set(c,pv) ((c)->cop_file = savesharedpv(pv)) + + #ifdef NETWARE + #define CopFILE_set(c,pv) ((c)->cop_file = savepv(pv)) + #else + #define CopFILE_set(c,pv) ((c)->cop_file = savesharedpv(pv)) + #endif + # define CopFILESV(c) (CopFILE(c) \ ? GvSV(gv_fetchfile(CopFILE(c))) : Nullsv) # define CopFILEAV(c) (CopFILE(c) \ ? GvAV(gv_fetchfile(CopFILE(c))) : Nullav) # define CopSTASHPV(c) ((c)->cop_stashpv) -# define CopSTASHPV_set(c,pv) ((c)->cop_stashpv = savesharedpv(pv)) + + #ifdef NETWARE + #define CopSTASHPV_set(c,pv) ((c)->cop_stashpv = ((pv) ? savepv(pv) : Nullch)) + #else + #define CopSTASHPV_set(c,pv) ((c)->cop_stashpv = savesharedpv(pv)) + #endif + # define CopSTASH(c) (CopSTASHPV(c) \ ? gv_stashpv(CopSTASHPV(c),GV_ADD) : Nullhv) # define CopSTASH_set(c,hv) CopSTASHPV_set(c, (hv) ? HvNAME(hv) : Nullch) @@ -44,8 +56,17 @@ struct cop { && (CopSTASHPV(c) == HvNAME(hv) \ || (CopSTASHPV(c) && HvNAME(hv) \ && strEQ(CopSTASHPV(c), HvNAME(hv))))) -# define CopSTASH_free(c) PerlMemShared_free(CopSTASHPV(c)) -# define CopFILE_free(c) (PerlMemShared_free(CopFILE(c)),(CopFILE(c) = Nullch)) + #ifdef NETWARE + #define CopSTASH_free(c) SAVECOPSTASH_FREE(c) + #else + #define CopSTASH_free(c) PerlMemShared_free(CopSTASHPV(c)) + #endif + + #ifdef NETWARE + #define CopFILE_free(c) SAVECOPFILE_FREE(c) + #else + #define CopFILE_free(c) (PerlMemShared_free(CopFILE(c)),(CopFILE(c) = Nullch)) + #endif #else # define CopFILEGV(c) ((c)->cop_filegv) # define CopFILEGV_set(c,gv) ((c)->cop_filegv = (GV*)SvREFCNT_inc(gv)) diff --git a/iperlsys.h b/iperlsys.h index 7eda973426..b2b21727e4 100644 --- a/iperlsys.h +++ b/iperlsys.h @@ -795,6 +795,25 @@ struct IPerlMemInfo (*PL_Mem->pIsLocked)(PL_Mem) /* Shared memory macros */ +#ifdef NETWARE + + #define PerlMemShared_malloc(size) \ + (*PL_Mem->pMalloc)(PL_Mem, (size)) +#define PerlMemShared_realloc(buf, size) \ + (*PL_Mem->pRealloc)(PL_Mem, (buf), (size)) +#define PerlMemShared_free(buf) \ + (*PL_Mem->pFree)(PL_Mem, (buf)) +#define PerlMemShared_calloc(num, size) \ + (*PL_Mem->pCalloc)(PL_Mem, (num), (size)) +#define PerlMemShared_get_lock() \ + (*PL_Mem->pGetLock)(PL_Mem) +#define PerlMemShared_free_lock() \ + (*PL_Mem->pFreeLock)(PL_Mem) +#define PerlMemShared_is_locked() \ + (*PL_Mem->pIsLocked)(PL_Mem) + +#else + #define PerlMemShared_malloc(size) \ (*PL_MemShared->pMalloc)(PL_MemShared, (size)) #define PerlMemShared_realloc(buf, size) \ @@ -810,6 +829,7 @@ struct IPerlMemInfo #define PerlMemShared_is_locked() \ (*PL_MemShared->pIsLocked)(PL_MemShared) +#endif /* Parse tree memory macros */ #define PerlMemParse_malloc(size) \ @@ -45,8 +45,8 @@ S_Slab_Alloc(pTHX_ int m, size_t sz) */ sz = (sz + 2*sizeof(I32 *) -1)/sizeof(I32 *); if ((PL_OpSpace -= sz) < 0) { - PL_OpPtr = (I32 **) PerlMemShared_malloc(PERL_SLAB_SIZE*sizeof(I32*)); - if (!PL_OpPtr) { + PL_OpPtr = (I32 **) PerlMemShared_malloc(PERL_SLAB_SIZE*sizeof(I32*)); + if (!PL_OpPtr) { return NULL; } Zero(PL_OpPtr,PERL_SLAB_SIZE,I32 **); @@ -82,7 +82,11 @@ S_Slab_Free(pTHX_ void *op) assert( ptr < ( (I32 **) slab + PERL_SLAB_SIZE) ); assert( *slab > 0 ); if (--(*slab) == 0) { - PerlMemShared_free(slab); + #ifdef NETWARE + #define PerlMemShared PerlMem + #endif + + PerlMemShared_free(slab); if (slab == PL_OpSlab) { PL_OpSpace = 0; } |