Skip to content

Commit

Permalink
Refactor classes to inherit from SmallObjectBase (#192)
Browse files Browse the repository at this point in the history
Added `mem::SmallObjectBase` as a base class to `StreamInterface` and `AlgebraInterfaceBase` for optimized memory handling of small objects. Updated necessary includes to ensure proper integration. This enhances performance and memory efficiency across the codebase.
  • Loading branch information
inakleinbottle authored Dec 19, 2024
1 parent 846dfb7 commit fd7e52f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include <roughpy/algebra/context_fwd.h>

#include <roughpy/core/macros.h>
#include "roughpy/platform/alloc.h"
#include <roughpy/scalars/scalar_type.h>


Expand All @@ -47,7 +48,7 @@ namespace dtl {
* various places. If you define an algebra interface, it should derive
* from the base AlgebraInterface, which publicly derives from this tag.
*/
class AlgebraInterfaceBase
class AlgebraInterfaceBase : public mem::SmallObjectBase
{
protected:
context_pointer p_ctx;
Expand Down
3 changes: 2 additions & 1 deletion streams/include/roughpy/streams/stream_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
#include <roughpy/intervals/real_interval.h>
#include <roughpy/platform/serialization.h>
#include <roughpy/platform/errors.h>
#include "roughpy/platform/alloc.h"

#include "schema.h"

Expand Down Expand Up @@ -97,7 +98,7 @@ inline resolution_t param_to_resolution(param_t arg) noexcept
* computed from log signatures, rather than using the data to compute these
* independently.)
*/
class ROUGHPY_STREAMS_EXPORT StreamInterface
class ROUGHPY_STREAMS_EXPORT StreamInterface : public mem::SmallObjectBase
{
StreamMetadata m_metadata;
std::shared_ptr<StreamSchema> p_schema;
Expand Down

0 comments on commit fd7e52f

Please sign in to comment.