xbpeng / DeepTerrainRL

terrain-adaptive locomotion skills using deep reinforcement learning
GNU Lesser General Public License v3.0
432 stars 129 forks source link

unique_ptr for mNet, and shared_ptr for mSolver? #21

Closed shihuiguo closed 7 years ago

shihuiguo commented 7 years ago

Is there any specific reason for adopting the usage of unique_ptr and shared_ptr? Is it related to the data synchronisation during the parallel computing?

Thanks.

Shihui

xbpeng commented 7 years ago

It was mainly to help prevent memory leaks.

shihuiguo commented 7 years ago

Thanks Peng.

But is this approach mandatory or recommended? I am wondering whether I should adopt the same mechanism in my code, =)

Shihui

xbpeng commented 7 years ago

I think it's safer than using raw pointers.