Comments (6)
I'm going to add a simple interface that lets you pass in callbacks that will be called on alloc/dealloc. That lets users of the library implement their own tracking, with zero overhead if you don't use it.
from physx-rs.
Assume PhysX does support overriding their allocator also? Could be quite nice to support overriding it and connect it to the Rust global memory allocator (or rather: A Rust memory allocator of the users choosing) through the standard trait or a custom one. This is what we use in our engine and great to have most heap allocations in the same main allocator. Assuming the interfaces and needs are similar.
from physx-rs.
Yeah, we can also replace the whole allocator. Can try that instead. Physx does send in a bit of extra metadata that we really want to track separately (as Emil mentions), but can then pass through to a Rust alloc.
from physx-rs.
Cool, worth a shot
from physx-rs.
I implemented a super rudimentary tracking allocator here.
If the allocation name feature works, that would enable a proper type aware allocator which would be amazing, but IIRC it's debug only, and debug doesn't work or something. I'd love to be wrong there though.
Without that, the allocator is a C-style void-pointer allocator, and wrapping Rust's lovely type aware one in that feels dirty.
from physx-rs.
The allocation name feature actually kinda mostly works in release mode, you just have to call
foundation.set_report_allocation_names(true);
. PhysX does a quite good job of pooling internally so most of what you'll see are pools of various types.
In our application we implemented a tracker on top of the trampoline I added in #94 , actually very similar to yours.
from physx-rs.
Related Issues (20)
- Port PxCooking
- Emit default values in FFI bindings
- Reevaluate structgen HOT 1
- Cleanup C++ source files
- Flow support? HOT 2
- Generate `physx-safe` on top of `physx-sys`
- run error in msvs target HOT 4
- Build error after updating ubuntu HOT 7
- Spring/damper has no effect in driving articulation joint HOT 10
- ActorMap is missing read-only API HOT 2
- How to create a TriangleMeshGeometry in Rust? HOT 6
- Unable to get collision callbacks in bouncing ball example. HOT 6
- Misaligned pointer dereference HOT 24
- How can i remove a Rigid Dynamic actor from scene when it collide with a specific object ? HOT 2
- `pxbind` needs update HOT 1
- iOS support HOT 1
- How to create completion task for passing in scene.step function ?
- Add support for `eDEFAULT` for bitflags (and maybe enums)
- Change MacOS CI to aarch64
- Round out `Controller` trait functions 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 physx-rs.