mirror of
https://github.com/Samsung/escargot.git
synced 2026-06-22 10:01:50 +00:00
Remove GC_size with alloc logic since it produces ci error
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
This commit is contained in:
parent
9f59be13c2
commit
a4021a97f4
4 changed files with 22 additions and 29 deletions
|
|
@ -1210,8 +1210,7 @@ public:
|
|||
|
||||
void preparePropertyStorage(size_t t)
|
||||
{
|
||||
ASSERT(ownPropertyCountOnStructure() == 0);
|
||||
m_values.expandBuffer(t, 0);
|
||||
m_values.expandBuffer(t);
|
||||
}
|
||||
|
||||
protected:
|
||||
|
|
|
|||
|
|
@ -345,7 +345,7 @@ ObjectStructure* ObjectStructureWithTransition::addProperty(const ObjectStructur
|
|||
} else {
|
||||
if (m_transitionTableVectorBufferCapacity <= (size_t)(m_transitionTableVectorBufferSize + 1)) {
|
||||
m_transitionTableVectorBufferCapacity = std::min(computeVectorAllocateSize(m_transitionTableVectorBufferSize + 1), (size_t)std::numeric_limits<uint8_t>::max());
|
||||
m_transitionTableVectorBuffer = (ObjectStructureTransitionVectorItem*)GC_REALLOC(m_transitionTableVectorBuffer, sizeof(ObjectStructureTransitionVectorItem) * m_transitionTableVectorBufferCapacity);
|
||||
m_transitionTableVectorBuffer = (ObjectStructureTransitionVectorItem*)GC_REALLOC_NO_SHRINK(m_transitionTableVectorBuffer, sizeof(ObjectStructureTransitionVectorItem) * m_transitionTableVectorBufferCapacity);
|
||||
}
|
||||
m_transitionTableVectorBuffer[m_transitionTableVectorBufferSize] = newTransitionItem;
|
||||
m_transitionTableVectorBufferSize++;
|
||||
|
|
|
|||
|
|
@ -119,13 +119,9 @@ public:
|
|||
|
||||
void pushBack(const T& val)
|
||||
{
|
||||
if (
|
||||
#if defined(NDEBUG)
|
||||
GC_size(m_buffer) < (m_size + 1) * sizeof(T)
|
||||
#else
|
||||
true
|
||||
#endif
|
||||
) {
|
||||
if (std::is_fundamental<T>::value && m_buffer) {
|
||||
m_buffer = reinterpret_cast<T*>(GC_REALLOC_NO_SHRINK(m_buffer, (m_size + 1) * sizeof(T)));
|
||||
} else {
|
||||
T* newBuffer = Allocator().allocate(m_size + 1);
|
||||
VectorCopier<T>::copy(newBuffer, m_buffer, m_size);
|
||||
if (m_buffer) {
|
||||
|
|
@ -365,13 +361,9 @@ public:
|
|||
|
||||
void pushBack(const T& val, size_t newSize)
|
||||
{
|
||||
if (
|
||||
#if defined(NDEBUG)
|
||||
GC_size(m_buffer) < newSize * sizeof(T)
|
||||
#else
|
||||
true
|
||||
#endif
|
||||
) {
|
||||
if (std::is_fundamental<T>::value && m_buffer) {
|
||||
m_buffer = reinterpret_cast<T*>(GC_REALLOC_NO_SHRINK(m_buffer, newSize * sizeof(T)));
|
||||
} else {
|
||||
T* newBuffer = Allocator().allocate(newSize);
|
||||
VectorCopier<T>::copy(newBuffer, m_buffer, newSize - 1);
|
||||
if (m_buffer) {
|
||||
|
|
@ -591,25 +583,27 @@ public:
|
|||
m_buffer = resetData;
|
||||
}
|
||||
|
||||
void expandBuffer(size_t newSize)
|
||||
{
|
||||
if (m_buffer == nullptr) {
|
||||
if (newSize) {
|
||||
m_buffer = GCAllocator().allocate(newSize);
|
||||
}
|
||||
} else {
|
||||
m_buffer = reinterpret_cast<T*>(GC_REALLOC_NO_SHRINK(m_buffer, newSize * sizeof(T)));
|
||||
}
|
||||
}
|
||||
|
||||
protected:
|
||||
void expandBuffer(size_t newSize, size_t oldSize)
|
||||
{
|
||||
if (m_buffer == nullptr) {
|
||||
m_buffer = GCAllocator().allocate(newSize);
|
||||
} else {
|
||||
#if defined(NDEBUG)
|
||||
if (GC_size(m_buffer) < newSize * sizeof(T)) {
|
||||
auto newBuffer = GCAllocator().allocate(newSize);
|
||||
VectorCopier<T>::copy(newBuffer, m_buffer, oldSize);
|
||||
GC_FREE(m_buffer);
|
||||
m_buffer = newBuffer;
|
||||
}
|
||||
#else
|
||||
m_buffer = (T*)GC_REALLOC(m_buffer, newSize * sizeof(T));
|
||||
#endif
|
||||
m_buffer = reinterpret_cast<T*>(GC_REALLOC_NO_SHRINK(m_buffer, newSize * sizeof(T)));
|
||||
}
|
||||
}
|
||||
|
||||
protected:
|
||||
T* m_buffer;
|
||||
};
|
||||
} // namespace Escargot
|
||||
|
|
|
|||
2
third_party/GCutil
vendored
2
third_party/GCutil
vendored
|
|
@ -1 +1 @@
|
|||
Subproject commit 02ce390f376b9dd56f6d4bc4168914b4222181f6
|
||||
Subproject commit ec2cbd4fa956b5c6fc3d42b60bbc28f79ec27bcc
|
||||
Loading…
Add table
Add a link
Reference in a new issue