X-Git-Url: https://git.saurik.com/apple/javascriptcore.git/blobdiff_plain/81345200c95645a1b0d2635520f96ad55dfde63f..refs/heads/master:/runtime/StructureIDTable.cpp?ds=sidebyside diff --git a/runtime/StructureIDTable.cpp b/runtime/StructureIDTable.cpp index 57acd29..8aa89b0 100644 --- a/runtime/StructureIDTable.cpp +++ b/runtime/StructureIDTable.cpp @@ -29,13 +29,12 @@ #include #include #include -#include namespace JSC { StructureIDTable::StructureIDTable() : m_firstFreeOffset(0) - , m_table(adoptPtr(new StructureOrOffset[s_initialSize])) + , m_table(std::make_unique(s_initialSize)) , m_size(0) , m_capacity(s_initialSize) { @@ -47,7 +46,7 @@ StructureIDTable::StructureIDTable() void StructureIDTable::resize(size_t newCapacity) { // Create the new table. - OwnPtr newTable = adoptPtr(new StructureOrOffset[newCapacity]); + auto newTable = std::make_unique(newCapacity); // Copy the contents of the old table to the new table. memcpy(newTable.get(), table(), m_capacity * sizeof(StructureOrOffset)); @@ -59,7 +58,7 @@ void StructureIDTable::resize(size_t newCapacity) swap(m_table, newTable); // Put the old table (now labeled as new) into the list of old tables. - m_oldTables.append(newTable.release()); + m_oldTables.append(WTF::move(newTable)); // Update the capacity. m_capacity = newCapacity;