Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement manual handling of objects in the library heap #36

Open
PetrPPetrov opened this issue Apr 3, 2017 · 0 comments
Open

Implement manual handling of objects in the library heap #36

PetrPPetrov opened this issue Apr 3, 2017 · 0 comments

Comments

@PetrPPetrov
Copy link
Owner

Something like that:

class Printer
{
public:
    void Show() {
        printer_show(this);
    }

    static void * operator new(size_t size) {
        assert(size == sizeof Printer);
        return printer_create();
    }
    
    static void operator delete(void * obj, size_t size) {
        assert(size == sizeof Printer);
        printer_destroy(obj);
    }
};

The idea was contributed by @vdimas

@PetrPPetrov PetrPPetrov added this to the v0.5 milestone Apr 3, 2017
@PetrPPetrov PetrPPetrov modified the milestones: v0.5, v0.5.1 Mar 29, 2018
@PetrPPetrov PetrPPetrov modified the milestones: v0.5.1, v0.5.2 Sep 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant