2014-05-05 21:30:46 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
2012-05-21 15:12:37 +04:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2004-02-19 05:44:03 +03:00
|
|
|
|
|
|
|
#ifdef DEBUG
|
|
|
|
#define ENABLE_STRING_STATS
|
|
|
|
#endif
|
|
|
|
|
2013-08-22 19:14:42 +04:00
|
|
|
#include "mozilla/Atomics.h"
|
2013-06-23 16:03:39 +04:00
|
|
|
#include "mozilla/MemoryReporting.h"
|
|
|
|
|
2004-02-19 05:44:03 +03:00
|
|
|
#ifdef ENABLE_STRING_STATS
|
|
|
|
#include <stdio.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include "nsSubstring.h"
|
|
|
|
#include "nsString.h"
|
2005-02-03 01:18:37 +03:00
|
|
|
#include "nsStringBuffer.h"
|
2004-02-19 05:44:03 +03:00
|
|
|
#include "nsDependentString.h"
|
|
|
|
#include "nsMemory.h"
|
2009-11-05 00:33:23 +03:00
|
|
|
#include "prprf.h"
|
2010-03-08 18:44:59 +03:00
|
|
|
#include "nsStaticAtom.h"
|
2013-04-22 15:13:22 +04:00
|
|
|
#include "nsCOMPtr.h"
|
2004-02-19 05:44:03 +03:00
|
|
|
|
2013-11-21 23:17:35 +04:00
|
|
|
#include "mozilla/IntegerPrintfMacros.h"
|
|
|
|
#ifdef XP_WIN
|
|
|
|
#include <windows.h>
|
|
|
|
#include <process.h>
|
|
|
|
#define getpid() _getpid()
|
|
|
|
#define pthread_self() GetCurrentThreadId()
|
|
|
|
#else
|
|
|
|
#include <pthread.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
#endif
|
|
|
|
|
2013-08-22 19:14:42 +04:00
|
|
|
using mozilla::Atomic;
|
|
|
|
|
2004-02-19 05:44:03 +03:00
|
|
|
// ---------------------------------------------------------------------------
|
|
|
|
|
2014-02-03 16:27:56 +04:00
|
|
|
static const char16_t gNullChar = 0;
|
2004-02-19 05:44:03 +03:00
|
|
|
|
2014-02-03 16:27:56 +04:00
|
|
|
char* const nsCharTraits<char>::sEmptyBuffer =
|
2014-05-27 11:15:35 +04:00
|
|
|
(char*)const_cast<char16_t*>(&gNullChar);
|
2014-02-03 16:27:56 +04:00
|
|
|
char16_t* const nsCharTraits<char16_t>::sEmptyBuffer =
|
|
|
|
const_cast<char16_t*>(&gNullChar);
|
2004-02-19 05:44:03 +03:00
|
|
|
|
|
|
|
// ---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
#ifdef ENABLE_STRING_STATS
|
|
|
|
class nsStringStats
|
2014-05-05 21:30:46 +04:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
nsStringStats()
|
2014-05-27 11:15:35 +04:00
|
|
|
: mAllocCount(0)
|
|
|
|
, mReallocCount(0)
|
|
|
|
, mFreeCount(0)
|
|
|
|
, mShareCount(0)
|
|
|
|
{
|
|
|
|
}
|
2014-05-05 21:30:46 +04:00
|
|
|
|
|
|
|
~nsStringStats()
|
2004-02-19 05:44:03 +03:00
|
|
|
{
|
2014-05-05 21:30:46 +04:00
|
|
|
// this is a hack to suppress duplicate string stats printing
|
|
|
|
// in seamonkey as a result of the string code being linked
|
|
|
|
// into seamonkey and libxpcom! :-(
|
2014-05-27 11:15:35 +04:00
|
|
|
if (!mAllocCount && !mAdoptCount) {
|
2014-05-05 21:30:46 +04:00
|
|
|
return;
|
2014-05-27 11:15:35 +04:00
|
|
|
}
|
2014-05-05 21:30:46 +04:00
|
|
|
|
|
|
|
printf("nsStringStats\n");
|
|
|
|
printf(" => mAllocCount: % 10d\n", int(mAllocCount));
|
|
|
|
printf(" => mReallocCount: % 10d\n", int(mReallocCount));
|
|
|
|
printf(" => mFreeCount: % 10d", int(mFreeCount));
|
2014-05-27 11:15:35 +04:00
|
|
|
if (mAllocCount > mFreeCount) {
|
2014-05-05 21:30:46 +04:00
|
|
|
printf(" -- LEAKED %d !!!\n", mAllocCount - mFreeCount);
|
2014-05-27 11:15:35 +04:00
|
|
|
} else {
|
2014-05-05 21:30:46 +04:00
|
|
|
printf("\n");
|
2014-05-27 11:15:35 +04:00
|
|
|
}
|
2014-05-05 21:30:46 +04:00
|
|
|
printf(" => mShareCount: % 10d\n", int(mShareCount));
|
|
|
|
printf(" => mAdoptCount: % 10d\n", int(mAdoptCount));
|
|
|
|
printf(" => mAdoptFreeCount: % 10d", int(mAdoptFreeCount));
|
2014-05-27 11:15:35 +04:00
|
|
|
if (mAdoptCount > mAdoptFreeCount) {
|
2014-05-05 21:30:46 +04:00
|
|
|
printf(" -- LEAKED %d !!!\n", mAdoptCount - mAdoptFreeCount);
|
2014-05-27 11:15:35 +04:00
|
|
|
} else {
|
2014-05-05 21:30:46 +04:00
|
|
|
printf("\n");
|
2014-05-27 11:15:35 +04:00
|
|
|
}
|
2014-05-05 21:30:46 +04:00
|
|
|
printf(" => Process ID: %" PRIuPTR ", Thread ID: %" PRIuPTR "\n",
|
|
|
|
uintptr_t(getpid()), uintptr_t(pthread_self()));
|
|
|
|
}
|
|
|
|
|
|
|
|
Atomic<int32_t> mAllocCount;
|
|
|
|
Atomic<int32_t> mReallocCount;
|
|
|
|
Atomic<int32_t> mFreeCount;
|
|
|
|
Atomic<int32_t> mShareCount;
|
|
|
|
Atomic<int32_t> mAdoptCount;
|
|
|
|
Atomic<int32_t> mAdoptFreeCount;
|
|
|
|
};
|
2004-02-19 05:44:03 +03:00
|
|
|
static nsStringStats gStringStats;
|
2013-08-22 19:14:42 +04:00
|
|
|
#define STRING_STAT_INCREMENT(_s) (gStringStats.m ## _s ## Count)++
|
2004-02-19 05:44:03 +03:00
|
|
|
#else
|
|
|
|
#define STRING_STAT_INCREMENT(_s)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
// ---------------------------------------------------------------------------
|
|
|
|
|
2014-12-13 02:57:09 +03:00
|
|
|
void
|
2014-05-27 11:15:35 +04:00
|
|
|
ReleaseData(void* aData, uint32_t aFlags)
|
2014-05-05 21:30:46 +04:00
|
|
|
{
|
2014-05-27 11:15:35 +04:00
|
|
|
if (aFlags & nsSubstring::F_SHARED) {
|
|
|
|
nsStringBuffer::FromData(aData)->Release();
|
|
|
|
} else if (aFlags & nsSubstring::F_OWNED) {
|
2015-03-27 03:01:12 +03:00
|
|
|
free(aData);
|
2014-05-05 21:30:46 +04:00
|
|
|
STRING_STAT_INCREMENT(AdoptFree);
|
|
|
|
// Treat this as destruction of a "StringAdopt" object for leak
|
|
|
|
// tracking purposes.
|
2015-04-03 16:52:00 +03:00
|
|
|
MOZ_LOG_DTOR(aData, "StringAdopt", 1);
|
2005-02-03 01:18:37 +03:00
|
|
|
}
|
2014-05-05 21:30:46 +04:00
|
|
|
// otherwise, nothing to do.
|
|
|
|
}
|
2005-02-03 01:18:37 +03:00
|
|
|
|
|
|
|
// ---------------------------------------------------------------------------
|
2004-02-19 05:44:03 +03:00
|
|
|
|
2005-02-03 01:18:37 +03:00
|
|
|
// XXX or we could make nsStringBuffer be a friend of nsTAString
|
|
|
|
|
|
|
|
class nsAStringAccessor : public nsAString
|
2014-05-05 21:30:46 +04:00
|
|
|
{
|
|
|
|
private:
|
|
|
|
nsAStringAccessor(); // NOT IMPLEMENTED
|
|
|
|
|
|
|
|
public:
|
2014-05-27 11:15:35 +04:00
|
|
|
char_type* data() const
|
|
|
|
{
|
|
|
|
return mData;
|
|
|
|
}
|
|
|
|
size_type length() const
|
|
|
|
{
|
|
|
|
return mLength;
|
|
|
|
}
|
|
|
|
uint32_t flags() const
|
|
|
|
{
|
|
|
|
return mFlags;
|
|
|
|
}
|
2014-05-05 21:30:46 +04:00
|
|
|
|
2014-05-27 11:15:35 +04:00
|
|
|
void set(char_type* aData, size_type aLen, uint32_t aFlags)
|
2005-02-03 01:18:37 +03:00
|
|
|
{
|
2014-05-05 21:30:46 +04:00
|
|
|
ReleaseData(mData, mFlags);
|
2014-05-27 11:15:35 +04:00
|
|
|
mData = aData;
|
|
|
|
mLength = aLen;
|
|
|
|
mFlags = aFlags;
|
2014-05-05 21:30:46 +04:00
|
|
|
}
|
|
|
|
};
|
2004-02-19 05:44:03 +03:00
|
|
|
|
2005-02-03 01:18:37 +03:00
|
|
|
class nsACStringAccessor : public nsACString
|
2014-05-05 21:30:46 +04:00
|
|
|
{
|
|
|
|
private:
|
|
|
|
nsACStringAccessor(); // NOT IMPLEMENTED
|
|
|
|
|
|
|
|
public:
|
2014-05-27 11:15:35 +04:00
|
|
|
char_type* data() const
|
|
|
|
{
|
|
|
|
return mData;
|
|
|
|
}
|
|
|
|
size_type length() const
|
|
|
|
{
|
|
|
|
return mLength;
|
|
|
|
}
|
|
|
|
uint32_t flags() const
|
|
|
|
{
|
|
|
|
return mFlags;
|
|
|
|
}
|
2014-05-05 21:30:46 +04:00
|
|
|
|
2014-05-27 11:15:35 +04:00
|
|
|
void set(char_type* aData, size_type aLen, uint32_t aFlags)
|
2005-02-03 01:18:37 +03:00
|
|
|
{
|
2014-05-05 21:30:46 +04:00
|
|
|
ReleaseData(mData, mFlags);
|
2014-05-27 11:15:35 +04:00
|
|
|
mData = aData;
|
|
|
|
mLength = aLen;
|
|
|
|
mFlags = aFlags;
|
2014-05-05 21:30:46 +04:00
|
|
|
}
|
|
|
|
};
|
2004-02-19 05:44:03 +03:00
|
|
|
|
2005-02-03 01:18:37 +03:00
|
|
|
// ---------------------------------------------------------------------------
|
2004-02-19 05:44:03 +03:00
|
|
|
|
2005-02-03 01:18:37 +03:00
|
|
|
void
|
|
|
|
nsStringBuffer::AddRef()
|
2014-05-05 21:30:46 +04:00
|
|
|
{
|
|
|
|
++mRefCount;
|
|
|
|
STRING_STAT_INCREMENT(Share);
|
|
|
|
NS_LOG_ADDREF(this, mRefCount, "nsStringBuffer", sizeof(*this));
|
|
|
|
}
|
2004-02-19 05:44:03 +03:00
|
|
|
|
2005-02-03 01:18:37 +03:00
|
|
|
void
|
|
|
|
nsStringBuffer::Release()
|
2014-05-05 21:30:46 +04:00
|
|
|
{
|
|
|
|
int32_t count = --mRefCount;
|
|
|
|
NS_LOG_RELEASE(this, count, "nsStringBuffer");
|
2014-05-27 11:15:35 +04:00
|
|
|
if (count == 0) {
|
2014-05-05 21:30:46 +04:00
|
|
|
STRING_STAT_INCREMENT(Free);
|
|
|
|
free(this); // we were allocated with |malloc|
|
2005-02-03 01:18:37 +03:00
|
|
|
}
|
2014-05-05 21:30:46 +04:00
|
|
|
}
|
2004-02-19 05:44:03 +03:00
|
|
|
|
2014-05-05 21:30:46 +04:00
|
|
|
/**
|
|
|
|
* Alloc returns a pointer to a new string header with set capacity.
|
|
|
|
*/
|
2013-04-22 15:13:22 +04:00
|
|
|
already_AddRefed<nsStringBuffer>
|
2014-05-27 11:15:35 +04:00
|
|
|
nsStringBuffer::Alloc(size_t aSize)
|
2014-05-05 21:30:46 +04:00
|
|
|
{
|
2014-05-27 11:15:35 +04:00
|
|
|
NS_ASSERTION(aSize != 0, "zero capacity allocation not allowed");
|
|
|
|
NS_ASSERTION(sizeof(nsStringBuffer) + aSize <= size_t(uint32_t(-1)) &&
|
|
|
|
sizeof(nsStringBuffer) + aSize > aSize,
|
2014-05-05 21:30:46 +04:00
|
|
|
"mStorageSize will truncate");
|
|
|
|
|
2014-05-27 11:15:35 +04:00
|
|
|
nsStringBuffer* hdr =
|
|
|
|
(nsStringBuffer*)malloc(sizeof(nsStringBuffer) + aSize);
|
|
|
|
if (hdr) {
|
2014-05-05 21:30:46 +04:00
|
|
|
STRING_STAT_INCREMENT(Alloc);
|
|
|
|
|
|
|
|
hdr->mRefCount = 1;
|
2014-05-27 11:15:35 +04:00
|
|
|
hdr->mStorageSize = aSize;
|
2014-05-05 21:30:46 +04:00
|
|
|
NS_LOG_ADDREF(hdr, 1, "nsStringBuffer", sizeof(*hdr));
|
2005-02-03 01:18:37 +03:00
|
|
|
}
|
2014-05-05 21:30:46 +04:00
|
|
|
return dont_AddRef(hdr);
|
|
|
|
}
|
2004-02-19 05:44:03 +03:00
|
|
|
|
2005-02-03 01:18:37 +03:00
|
|
|
nsStringBuffer*
|
2014-05-27 11:15:35 +04:00
|
|
|
nsStringBuffer::Realloc(nsStringBuffer* aHdr, size_t aSize)
|
2014-05-05 21:30:46 +04:00
|
|
|
{
|
|
|
|
STRING_STAT_INCREMENT(Realloc);
|
|
|
|
|
2014-05-27 11:15:35 +04:00
|
|
|
NS_ASSERTION(aSize != 0, "zero capacity allocation not allowed");
|
|
|
|
NS_ASSERTION(sizeof(nsStringBuffer) + aSize <= size_t(uint32_t(-1)) &&
|
|
|
|
sizeof(nsStringBuffer) + aSize > aSize,
|
2014-05-05 21:30:46 +04:00
|
|
|
"mStorageSize will truncate");
|
|
|
|
|
|
|
|
// no point in trying to save ourselves if we hit this assertion
|
2014-05-27 11:15:35 +04:00
|
|
|
NS_ASSERTION(!aHdr->IsReadonly(), "|Realloc| attempted on readonly string");
|
2014-05-05 21:30:46 +04:00
|
|
|
|
|
|
|
// Treat this as a release and addref for refcounting purposes, since we
|
|
|
|
// just asserted that the refcount is 1. If we don't do that, refcount
|
|
|
|
// logging will claim we've leaked all sorts of stuff.
|
2014-05-27 11:15:35 +04:00
|
|
|
NS_LOG_RELEASE(aHdr, 0, "nsStringBuffer");
|
2014-05-05 21:30:46 +04:00
|
|
|
|
2014-05-27 11:15:35 +04:00
|
|
|
aHdr = (nsStringBuffer*)realloc(aHdr, sizeof(nsStringBuffer) + aSize);
|
|
|
|
if (aHdr) {
|
|
|
|
NS_LOG_ADDREF(aHdr, 1, "nsStringBuffer", sizeof(*aHdr));
|
|
|
|
aHdr->mStorageSize = aSize;
|
2005-02-03 01:18:37 +03:00
|
|
|
}
|
|
|
|
|
2014-05-27 11:15:35 +04:00
|
|
|
return aHdr;
|
2014-05-05 21:30:46 +04:00
|
|
|
}
|
|
|
|
|
2005-02-03 01:18:37 +03:00
|
|
|
nsStringBuffer*
|
2014-05-27 11:15:35 +04:00
|
|
|
nsStringBuffer::FromString(const nsAString& aStr)
|
2014-05-05 21:30:46 +04:00
|
|
|
{
|
|
|
|
const nsAStringAccessor* accessor =
|
2014-05-27 11:15:35 +04:00
|
|
|
static_cast<const nsAStringAccessor*>(&aStr);
|
2005-02-03 01:18:37 +03:00
|
|
|
|
2014-05-27 11:15:35 +04:00
|
|
|
if (!(accessor->flags() & nsSubstring::F_SHARED)) {
|
2014-05-05 21:30:46 +04:00
|
|
|
return nullptr;
|
2014-05-27 11:15:35 +04:00
|
|
|
}
|
2005-02-03 01:18:37 +03:00
|
|
|
|
2014-05-05 21:30:46 +04:00
|
|
|
return FromData(accessor->data());
|
|
|
|
}
|
2005-02-03 01:18:37 +03:00
|
|
|
|
|
|
|
nsStringBuffer*
|
2014-05-27 11:15:35 +04:00
|
|
|
nsStringBuffer::FromString(const nsACString& aStr)
|
2014-05-05 21:30:46 +04:00
|
|
|
{
|
|
|
|
const nsACStringAccessor* accessor =
|
2014-05-27 11:15:35 +04:00
|
|
|
static_cast<const nsACStringAccessor*>(&aStr);
|
2005-02-03 01:18:37 +03:00
|
|
|
|
2014-05-27 11:15:35 +04:00
|
|
|
if (!(accessor->flags() & nsCSubstring::F_SHARED)) {
|
2014-05-05 21:30:46 +04:00
|
|
|
return nullptr;
|
2014-05-27 11:15:35 +04:00
|
|
|
}
|
2005-02-03 01:18:37 +03:00
|
|
|
|
2014-05-05 21:30:46 +04:00
|
|
|
return FromData(accessor->data());
|
|
|
|
}
|
2005-02-03 01:18:37 +03:00
|
|
|
|
|
|
|
void
|
2014-05-27 11:15:35 +04:00
|
|
|
nsStringBuffer::ToString(uint32_t aLen, nsAString& aStr,
|
2011-09-29 10:19:26 +04:00
|
|
|
bool aMoveOwnership)
|
2014-05-05 21:30:46 +04:00
|
|
|
{
|
|
|
|
char16_t* data = static_cast<char16_t*>(Data());
|
2005-02-03 01:18:37 +03:00
|
|
|
|
2014-05-27 11:15:35 +04:00
|
|
|
nsAStringAccessor* accessor = static_cast<nsAStringAccessor*>(&aStr);
|
|
|
|
NS_ASSERTION(data[aLen] == char16_t(0), "data should be null terminated");
|
2005-02-03 01:18:37 +03:00
|
|
|
|
2014-05-05 21:30:46 +04:00
|
|
|
// preserve class flags
|
|
|
|
uint32_t flags = accessor->flags();
|
|
|
|
flags = (flags & 0xFFFF0000) | nsSubstring::F_SHARED | nsSubstring::F_TERMINATED;
|
2005-02-03 01:18:37 +03:00
|
|
|
|
2014-05-05 21:30:46 +04:00
|
|
|
if (!aMoveOwnership) {
|
|
|
|
AddRef();
|
2005-02-03 01:18:37 +03:00
|
|
|
}
|
2014-05-27 11:15:35 +04:00
|
|
|
accessor->set(data, aLen, flags);
|
2014-05-05 21:30:46 +04:00
|
|
|
}
|
2005-02-03 01:18:37 +03:00
|
|
|
|
|
|
|
void
|
2014-05-27 11:15:35 +04:00
|
|
|
nsStringBuffer::ToString(uint32_t aLen, nsACString& aStr,
|
2011-09-29 10:19:26 +04:00
|
|
|
bool aMoveOwnership)
|
2014-05-05 21:30:46 +04:00
|
|
|
{
|
|
|
|
char* data = static_cast<char*>(Data());
|
2005-02-03 01:18:37 +03:00
|
|
|
|
2014-05-27 11:15:35 +04:00
|
|
|
nsACStringAccessor* accessor = static_cast<nsACStringAccessor*>(&aStr);
|
|
|
|
NS_ASSERTION(data[aLen] == char(0), "data should be null terminated");
|
2005-02-03 01:18:37 +03:00
|
|
|
|
2014-05-05 21:30:46 +04:00
|
|
|
// preserve class flags
|
|
|
|
uint32_t flags = accessor->flags();
|
|
|
|
flags = (flags & 0xFFFF0000) | nsCSubstring::F_SHARED | nsCSubstring::F_TERMINATED;
|
2005-02-03 01:18:37 +03:00
|
|
|
|
2014-05-05 21:30:46 +04:00
|
|
|
if (!aMoveOwnership) {
|
|
|
|
AddRef();
|
2004-02-19 05:44:03 +03:00
|
|
|
}
|
2014-05-27 11:15:35 +04:00
|
|
|
accessor->set(data, aLen, flags);
|
2014-05-05 21:30:46 +04:00
|
|
|
}
|
2004-02-19 05:44:03 +03:00
|
|
|
|
2011-12-23 04:57:30 +04:00
|
|
|
size_t
|
2013-06-23 16:03:39 +04:00
|
|
|
nsStringBuffer::SizeOfIncludingThisIfUnshared(mozilla::MallocSizeOf aMallocSizeOf) const
|
2014-05-05 21:30:46 +04:00
|
|
|
{
|
2015-12-02 02:36:26 +03:00
|
|
|
return IsReadonly() ? 0 : aMallocSizeOf(this);
|
2014-05-05 21:30:46 +04:00
|
|
|
}
|
2011-12-23 04:57:30 +04:00
|
|
|
|
2013-01-18 09:21:35 +04:00
|
|
|
size_t
|
2013-06-23 16:03:39 +04:00
|
|
|
nsStringBuffer::SizeOfIncludingThisEvenIfShared(mozilla::MallocSizeOf aMallocSizeOf) const
|
2014-05-05 21:30:46 +04:00
|
|
|
{
|
|
|
|
return aMallocSizeOf(this);
|
|
|
|
}
|
2013-01-18 09:21:35 +04:00
|
|
|
|
2005-02-03 01:18:37 +03:00
|
|
|
// ---------------------------------------------------------------------------
|
|
|
|
|
2004-02-19 05:44:03 +03:00
|
|
|
|
2014-05-05 21:30:46 +04:00
|
|
|
// define nsSubstring
|
2004-02-19 05:44:03 +03:00
|
|
|
#include "string-template-def-unichar.h"
|
|
|
|
#include "nsTSubstring.cpp"
|
|
|
|
#include "string-template-undef.h"
|
|
|
|
|
2014-05-05 21:30:46 +04:00
|
|
|
// define nsCSubstring
|
2004-02-19 05:44:03 +03:00
|
|
|
#include "string-template-def-char.h"
|
|
|
|
#include "nsTSubstring.cpp"
|
|
|
|
#include "string-template-undef.h"
|
2008-07-30 10:06:54 +04:00
|
|
|
|
|
|
|
// Check that internal and external strings have the same size.
|
|
|
|
// See https://bugzilla.mozilla.org/show_bug.cgi?id=430581
|
|
|
|
|
2015-05-19 21:15:34 +03:00
|
|
|
#include "mozilla/Logging.h"
|
2008-07-30 10:06:54 +04:00
|
|
|
#include "nsXPCOMStrings.h"
|
|
|
|
|
2013-07-18 21:59:53 +04:00
|
|
|
static_assert(sizeof(nsStringContainer_base) == sizeof(nsSubstring),
|
|
|
|
"internal and external strings must have the same size");
|