Comments (2)
The ud is precisely the struct with the data I need and pass around.
The reason I usually have that sort of mapping, when I bind libraries, is that there are often situations where I have to retrieve the userdata from the pointer (not only the other way round).
I just gave a quick look at the code and I noticed that there are indeed places where I make an unnecessary search, which I could easily avoid by modyfing the check_Xxx() and test_Xxx() functions to
make them optionally return the ud together with the pointer. In other binding libraries I do this, in fact.
Not sure if this is a big deal, however, they are fast searches. Did you experience delays caused by them?
from moonfltk.
No delay at all. I agree that the code is fast. My only concern is code maintainability. You have to remember to keep that data structure up to date at all times otherwise you will experience bugs.
I will note that right now I have not noticed any bugs because of this. It was just something I was wondering about. I think for now we can close this and forget about this.
from moonfltk.
Related Issues (13)
- callbacks, lua states & coroutines HOT 5
- crash at program termination after using gtk native file chooser HOT 4
- MSYS2 (MinGW-W64) Error occurs on while compile "tree.cc" HOT 1
- Adding compatibility to Mac OS X HOT 19
- Cannot build in G++ (aarch64) with this errors. HOT 2
- Wrong information in documentation HOT 1
- Can't persuade lua to release memory using moonfltk and oocairo - probably my incompetence rather than a bug. HOT 5
- Can't compile on SparkyLinux. HOT 8
- $ make LUAVER=5.4 HOT 2
- RFC: Fluid exporter for Lua HOT 5
- FreeBSD build error HOT 2
- Lua 5.1 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from moonfltk.