{"action":"created","issue":{"url":"https://api.github.com/repos/RobotLocomotion/drake/issues/1854","repository_url":"https://api.github.com/repos/RobotLocomotion/drake","labels_url":"https://api.github.com/repos/RobotLocomotion/drake/issues/1854/labels{/name}","comments_url":"https://api.github.com/repos/RobotLocomotion/drake/issues/1854/comments","events_url":"https://api.github.com/repos/RobotLocomotion/drake/issues/1854/events","html_url":"https://github.com/RobotLocomotion/drake/issues/1854","id":140435639,"number":1854,"title":"Need a good solution to aligned allocation of Eigen object-containing classes","user":{"login":"sherm1","id":4088016,"avatar_url":"https://avatars.githubusercontent.com/u/4088016?v=3","gravatar_id":"","url":"https://api.github.com/users/sherm1","html_url":"https://github.com/sherm1","followers_url":"https://api.github.com/users/sherm1/followers","following_url":"https://api.github.com/users/sherm1/following{/other_user}","gists_url":"https://api.github.com/users/sherm1/gists{/gist_id}","starred_url":"https://api.github.com/users/sherm1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sherm1/subscriptions","organizations_url":"https://api.github.com/users/sherm1/orgs","repos_url":"https://api.github.com/users/sherm1/repos","events_url":"https://api.github.com/users/sherm1/events{/privacy}","received_events_url":"https://api.github.com/users/sherm1/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":37,"created_at":"2016-03-13T01:46:49Z","updated_at":"2016-04-29T15:30:34Z","closed_at":null,"body":"Any Drake class that contains aligned, fixed-size Eigen objects needs to have a custom `operator new` that aligns the whole class properly. STL containers and std::make_shared use the wrong one. Eigen has macros for dealing with this, but our current usage violates basic encapsulation because the class user must know its implementation in order to use it. A later addition of an aligned Eigen type as a private member of a previously Eigen-free class could break a lot of working user code. \r\n\r\nA lesser issue is two heap allocations for `shared_ptr(new Blah)` vs. one for`{make,allocate}_shared<Blah>()`.\r\n\r\nI know this has come up before and that there are workarounds, but I wanted to have an issue where we can discuss a permanent solution."},"comment":{"url":"https://api.github.com/repos/RobotLocomotion/drake/issues/comments/215758680","html_url":"https://github.com/RobotLocomotion/drake/issues/1854#issuecomment-215758680","issue_url":"https://api.github.com/repos/RobotLocomotion/drake/issues/1854","id":215758680,"user":{"login":"liangfok","id":1388098,"avatar_url":"https://avatars.githubusercontent.com/u/1388098?v=3","gravatar_id":"","url":"https://api.github.com/users/liangfok","html_url":"https://github.com/liangfok","followers_url":"https://api.github.com/users/liangfok/followers","following_url":"https://api.github.com/users/liangfok/following{/other_user}","gists_url":"https://api.github.com/users/liangfok/gists{/gist_id}","starred_url":"https://api.github.com/users/liangfok/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/liangfok/subscriptions","organizations_url":"https://api.github.com/users/liangfok/orgs","repos_url":"https://api.github.com/users/liangfok/repos","events_url":"https://api.github.com/users/liangfok/events{/privacy}","received_events_url":"https://api.github.com/users/liangfok/received_events","type":"User","site_admin":false},"created_at":"2016-04-29T15:30:34Z","updated_at":"2016-04-29T15:30:34Z","body":"I'm not seeing the difference since `EigenSafeClass` == `RigidBody` and `NeigenUnsafeClassContainer ` == `RibidBody_impl `. I would think that not enforcing a 1:1 relationship between the interface (e.g., `RigidBodySystem`) and the numerous implementations (e.g., `RigidBodyTree` and `RigidBodySensor`) would be desirable. Am I missing something obvious?"}}