Skip to content

Consider passing interface references by value instead by reference for interface method calls #14

@gprossliner

Description

@gprossliner

In v2 default interfaces will be created for each object (see #10). So you access object.interface_name to get a reference.

Currently in v1, the public interface methods are rendered like:
void interface_name_foo(interface * reference)

So you need to pass pointer to the interface.
This could be changed to passing a copy of the reference:
void interface_name_foo(interface reference)

PROS:

  • Cleaner API
  • No accidental modification of the reference in the implementation

CONT:

  • Instead of passing one pointer-sized field, the compiler has to pass a struct containing two pointer-sized fields (object and methodtable)

Decision is not finally...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions