reverting as per scc's request

This commit is contained in:
pavlov%netscape.com 1999-07-22 05:34:19 +00:00
parent 16e2ba6a23
commit d7695c62cf

View File

@ -23,7 +23,6 @@
#include "plstr.h" #include "plstr.h"
#include "nscore.h" #include "nscore.h"
#include "prtypes.h" #include "prtypes.h"
#include "nsCppSharedAllocator.h"
#define CR '\015' #define CR '\015'
#define LF '\012' #define LF '\012'
@ -197,15 +196,12 @@ public:
static PRInt32 strncasecmp(const PRUnichar* s1, const char* s2, static PRInt32 strncasecmp(const PRUnichar* s1, const char* s2,
PRUint32 aMaxLen); PRUint32 aMaxLen);
// Note: uses the global shared allocator |nsAllocator| through the C++ // Note: uses new[] to allocate memory, so you must use delete[] to
// |nsCppSharedAllocator| interface (matches C++ standard allocators). // free the memory
// So must the corresponding |free|, as below, must do the same.
static PRUnichar* strdup(const PRUnichar* str); static PRUnichar* strdup(const PRUnichar* str);
static void free(PRUnichar* str) { static void free(PRUnichar* str) {
nsCppSharedAllocator<PRUnichar> shared_allocator; delete[] str;
shared_allocator.deallocate(str, 0 /*we never new or kept the size*/);
// delete[] str;
} }
/// Compute a hashcode for a C string /// Compute a hashcode for a C string