Files
SalastilandClaude Opus 5.5 642284b662 Match container templates, EQString dtor, Adventure currency ctor
CChunkedArray<T>/CRefPtr<T> instances, vector-deleting dtors and implicit dtors
kept by the linker from this object (0x4016c5-0x40198e), plus EQString::~EQString
(0x4482fb). The original included <new>: delete[] goes to operator delete[].
Tools: header annotations resolve against every object, build tracks headers,
check --inline lists template/inline instances. 41 MATCH, 1 NONMATCHING.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-19 23:09:10 -04:00

47 lines
880 B
C++

#pragma once
// Growable array stored as an array of fixed-size chunks (each chunk is a new T[]).
template <class T>
class CChunkedArray {
public:
~CChunkedArray() { Reset(); }
void Reset();
int m_length;
int m_chunkSize;
int m_alloc;
int m_0c;
T** m_chunks;
int m_numChunks;
int m_18;
};
template <class T>
void CChunkedArray<T>::Reset()
{
for (int i = 0; i < m_numChunks; i++) {
if (m_chunks[i])
delete[] m_chunks[i];
}
delete[] m_chunks;
m_chunks = 0;
m_numChunks = 0;
m_length = 0;
}
// Intrusive reference-counted pointer; T has an int refcount and owns its own operator delete.
template <class T>
class CRefPtr {
public:
~CRefPtr()
{
if (m_p) {
m_p->m_refCount--;
if (m_p->m_refCount <= 0)
delete m_p;
}
}
T* m_p;
};