mirror of
https://github.com/Perl/perl5.git
synced 2026-01-26 08:38:23 +00:00
NetWare tweaks from C Aditya <caditya@novell.com>
p4raw-id: //depot/perl@15292
This commit is contained in:
parent
53133ed1c5
commit
083fcd59ca
@ -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,
|
||||
|
||||
29
cop.h
29
cop.h
@ -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))
|
||||
|
||||
20
iperlsys.h
20
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) \
|
||||
|
||||
10
op.c
10
op.c
@ -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;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user