- Timestamp:
- Nov 4, 2023 7:58:23 PM (16 months ago)
- svn:sync-xref-src-repo-rev:
- 159882
- Location:
- trunk/src/libs/xpcom18a4
- Files:
-
- 1 deleted
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/libs/xpcom18a4/Makefile.kmk
r101785 r101786 526 526 nsprpub/pr/src/io/prstdio.c \ 527 527 nsprpub/pr/src/linking/prlink.c \ 528 nsprpub/pr/src/malloc/prmem.c \529 528 nsprpub/pr/src/md/prosdep.c \ 530 529 nsprpub/pr/src/memory/prseg.c \ -
trunk/src/libs/xpcom18a4/nsprpub/pr/include/prmem.h
r11551 r101786 47 47 #include <stddef.h> 48 48 #include <stdlib.h> 49 #include <iprt/mem.h> 49 50 50 51 #ifdef VBOX_WITH_XPCOM_NAMESPACE_CLEANUP … … 64 65 */ 65 66 66 /* 67 ** PR_Malloc, PR_Calloc, PR_Realloc, and PR_Free have the same signatures 68 ** as their libc equivalent malloc, calloc, realloc, and free, and have 69 ** the same semantics. (Note that the argument type size_t is replaced 70 ** by PRUint32.) Memory allocated by PR_Malloc, PR_Calloc, or PR_Realloc 71 ** must be freed by PR_Free. 72 */ 67 #ifdef VBOX 68 DECL_FORCE_INLINE(void *) PR_Malloc(PRUint32 size) 69 { 70 return RTMemAlloc(RT_MAX(size, 1)); 71 } 73 72 74 NSPR_API(void *) PR_Malloc(PRUint32 size); 73 DECL_FORCE_INLINE(void *) PR_Calloc(PRUint32 nelem, PRUint32 elsize) 74 { 75 return RTMemAllocZ(RT_MAX(nelem * (size_t)elsize, 1)); 76 } 75 77 76 NSPR_API(void *) PR_Calloc(PRUint32 nelem, PRUint32 elsize); 78 DECL_FORCE_INLINE(void *) PR_Realloc(void *ptr, PRUint32 size) 79 { 80 return RTMemRealloc(ptr, size); 81 } 77 82 78 NSPR_API(void *) PR_Realloc(void *ptr, PRUint32 size); 79 80 NSPR_API(void) PR_Free(void *ptr); 83 DECL_FORCE_INLINE(void) PR_Free(void *ptr) 84 { 85 RTMemFree(ptr); 86 } 87 #else 88 # error "Not supported" 89 #endif 81 90 82 91 /*
Note:
See TracChangeset
for help on using the changeset viewer.