VirtualBox

Ignore:
Timestamp:
Nov 8, 2023 12:18:16 PM (15 months ago)
Author:
vboxsync
Message:

libs/xpcom: Get rid of the file descriptor cache in nsprpub as it isn't of any real use now, bugref:10545

Location:
trunk/src/libs/xpcom18a4/nsprpub/pr
Files:
1 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/libs/xpcom18a4/nsprpub/pr/include/private/primpl.h

    r101963 r101964  
    222222#define _PR_MD_GETOPENFILEINFO64 _MD_GETOPENFILEINFO64
    223223
    224 
    225 /*****************************************************************************/
    226 /************************** File descriptor caching **************************/
    227 /*****************************************************************************/
    228 extern void _PR_InitFdCache(void);
    229 extern void _PR_CleanupFdCache(void);
    230 extern PRFileDesc *_PR_Getfd(void);
    231 extern void _PR_Putfd(PRFileDesc *fd);
    232224
    233225/*
  • trunk/src/libs/xpcom18a4/nsprpub/pr/src/pthreads/ptio.c

    r101935 r101964  
    270270
    271271#endif  /* DEBUG */
     272
     273/*
     274** Allocate a file descriptor from the heap.
     275*/
     276static PRFileDesc *_PR_Getfd(void)
     277{
     278    PRFileDesc *fd = PR_NEW(PRFileDesc);
     279    if (NULL != fd)
     280    {
     281        fd->secret = PR_NEW(PRFilePrivate);
     282        if (NULL == fd->secret) PR_DELETE(fd);
     283    }
     284    if (fd == NULL)
     285        return NULL;
     286
     287    fd->dtor = NULL;
     288    fd->lower = fd->higher = NULL;
     289    fd->identity = PR_NSPR_IO_LAYER;
     290    memset(fd->secret, 0, sizeof(PRFilePrivate));
     291    return fd;
     292}  /* _PR_Getfd */
     293
     294static void _PR_Putfd(PRFileDesc *fd)
     295{
     296    PR_Free(fd->secret);
     297    PR_Free(fd);
     298}  /* _PR_Putfd */
    272299
    273300static void pt_poll_now(pt_Continuation *op)
     
    622649    PR_ASSERT(NULL != _pr_rename_lock);
    623650
    624     _PR_InitFdCache();  /* do that */
    625 
    626651    _pr_stdin = pt_SetMethods(0, PR_DESC_FILE, PR_FALSE, PR_TRUE);
    627652    _pr_stdout = pt_SetMethods(1, PR_DESC_FILE, PR_FALSE, PR_TRUE);
     
    659684    _PR_Putfd(_pr_stderr);
    660685    _pr_stderr = NULL;
    661 
    662     _PR_CleanupFdCache();
    663686
    664687    if (_pr_rename_lock)
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette