Skip to content
Discussion options

You must be logged in to vote

Hi @Ginko2501

The default constructor will just allocate the memory, but will not initialize it.
For initialize_sh_frame() to work, both the si.sh_frame.n and dp_du fields needs to be initialized. This is why it would crash if you only initialize the former.

As a general rule of thumb, I use dr.zeros everytime I allocate a new variable. If you take a look at some of the source code (Python or C++) you'll see that this is quite common.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@Ginko2501
Comment options

@njroussel
Comment options

Answer selected by njroussel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants