Skip to content

Commit

Permalink
Another TODO comment [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
jamadden committed Jan 20, 2022
1 parent a7fe116 commit b9fd4b0
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/greenlet/greenlet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2911,6 +2911,20 @@ greenlet_internal_mod_init() G_NOEXCEPT
NULL)));
m.PyAddObject("_C_API", c_api_object);
assert(c_api_object.REFCNT() == 2);

// cerr << "Sizes:"
// << "\n\tGreenlet : " << sizeof(Greenlet)
// << "\n\tUserGreenlet : " << sizeof(UserGreenlet)
// << "\n\tMainGreenlet : " << sizeof(MainGreenlet)
// << "\n\tExceptionState : " << sizeof(greenlet::ExceptionState)
// << "\n\tPythonState : " << sizeof(greenlet::PythonState)
// << "\n\tStackState : " << sizeof(greenlet::StackState)
// << "\n\tSwitchingArgs : " << sizeof(greenlet::SwitchingArgs)
// << "\n\tOwnedObject : " << sizeof(greenlet::refs::OwnedObject)
// << "\n\tBorrowedObject : " << sizeof(greenlet::refs::BorrowedObject)
// << "\n\tPyGreenlet : " << sizeof(PyGreenlet)
// << endl;

return m.borrow(); // But really it's the main reference.
}
catch (const LockInitError& e) {
Expand Down
3 changes: 3 additions & 0 deletions src/greenlet/greenlet_greenlet.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ using greenlet::refs::OwnedGreenlet;
using greenlet::refs::OwnedMainGreenlet;
using greenlet::refs::BorrowedGreenlet;

// XXX: TODO: Work to remove all virtual functions
// for speed of calling and size of objects (no vtable).
// One pattern is the Curiously Recurring Template
namespace greenlet
{
class ExceptionState
Expand Down

0 comments on commit b9fd4b0

Please sign in to comment.