Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add re-entrancy support / multiple instances #9

Merged
merged 5 commits into from
Dec 13, 2017
Merged

Conversation

MightyPork
Copy link
Owner

This PR adds re-entrancy and support for creating multiple instances.
The only limitation is that the instances must have the same TF_Config, i.e. the same field sizes and checksum type. This shouldn't normally be a problem.

TF_Init() now allocates the instance structure. Use TF_InitStatic() if you want to allocate it manually.
The tf struct has two user fields, userdata and usertag (void* and uint32_t, respectively). Set those to whatever you like after calling TF_Init() - those can then be checked in any listener or callback (e.g. TF_ClaimTx() or TF_WriteImpl() to distinguish the instances. .userdata can be a pointer to some custom user structure.

All demos have been updated to work with this new version.

@MightyPork MightyPork merged commit db0ae30 into master Dec 13, 2017
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant