Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions source/core/slang-relative-ptr.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,14 @@ struct RelativePtr
using Offset = typename Traits::Offset;
using UOffset = typename Traits::UOffset;

RelativePtr() = default;
RelativePtr(RelativePtr const& ptr) { set(ptr); }
RelativePtr(RelativePtr&& ptr) { set(ptr); }
RelativePtr(T* ptr) { set(ptr); }
SLANG_FORCE_INLINE RelativePtr() = default;
SLANG_FORCE_INLINE RelativePtr(RelativePtr const& ptr) { set(ptr); }
SLANG_FORCE_INLINE RelativePtr(RelativePtr&& ptr) { set(ptr); }
SLANG_FORCE_INLINE RelativePtr(T* ptr) { set(ptr); }

void operator=(RelativePtr const& ptr) { set(ptr); }
void operator=(RelativePtr&& ptr) { set(ptr); }
void operator=(T* ptr) { set(ptr); }
SLANG_FORCE_INLINE void operator=(RelativePtr const& ptr) { set(ptr); }
SLANG_FORCE_INLINE void operator=(RelativePtr&& ptr) { set(ptr); }
SLANG_FORCE_INLINE void operator=(T* ptr) { set(ptr); }

T* get() const
{
Expand Down Expand Up @@ -79,8 +79,8 @@ struct RelativePtr
SLANG_ASSERT(intptr_t(_offset) == offsetVal);
}

operator T*() const { return get(); }
T* operator->() const { return get(); }
SLANG_FORCE_INLINE operator T*() const { return get(); }
SLANG_FORCE_INLINE T* operator->() const { return get(); }

private:
Offset _offset = 0;
Expand Down
36 changes: 0 additions & 36 deletions source/slang/slang-fossil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,30 +77,6 @@ Fossil::AnyValPtr getRootValue(void const* data, Size size)

} // namespace Fossil

Size FossilizedStringObj::getSize() const
{
auto sizePtr = (FossilUInt*)this - 1;
return Size(*sizePtr);
}

UnownedTerminatedStringSlice FossilizedStringObj::get() const
{
auto size = getSize();
return UnownedTerminatedStringSlice((char*)this, size);
}

Count FossilizedContainerObjBase::getElementCount() const
{
auto countPtr = (FossilUInt*)this - 1;
return Size(*countPtr);
}

FossilizedValLayout* FossilizedVariantObj::getContentLayout() const
{
auto layoutPtrPtr = (FossilizedPtr<FossilizedValLayout>*)this - 1;
return (*layoutPtrPtr).get();
}

Fossil::AnyValRef Fossil::ValRef<FossilizedContainerObjBase>::getElement(Index index) const
{
SLANG_ASSERT(index >= 0);
Expand Down Expand Up @@ -137,16 +113,4 @@ Fossil::AnyValRef Fossil::ValRef<FossilizedRecordVal>::getField(Index index) con
return Fossil::AnyValRef(fieldPtr, fieldInfo->layout);
}

#if 0
FossilizedValRef getVariantContent(FossilizedVariantObjRef variantRef)
{
return getVariantContent(variantRef.getData());
}
#endif

Fossil::AnyValPtr getVariantContentPtr(FossilizedVariantObj* variantPtr)
{
return Fossil::AnyValPtr(variantPtr->getContentDataPtr(), variantPtr->getContentLayout());
}

} // namespace Slang
Loading
Loading