-
Notifications
You must be signed in to change notification settings - Fork 118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
oc_ansi.h: add some definitions used in mods (ModedlDB & BBP) #1811
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, some of this will get reshuffled again in #1597 but I don't see anything really problematic.
extern void* bbss_buffer_counts(int*, int**, int**, int*); | ||
extern void bbss_save_global(void*, char*, int); | ||
extern void bbss_restore_global(void*, char*, int); | ||
extern void bbss_save(void*, int, char*, int); | ||
extern void bbss_restore(void*, int, int, char*, int); | ||
extern void bbss_save_done(void*); | ||
extern void bbss_restore_done(void*); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to say that these are included in a different header in #1597:
Lines 59 to 118 in f4290eb
/** BBSaveState API | |
* See save_test_bin and restore_test_bin for an example of the use of this | |
* following interface. Note in particular the use in restore_test_bin of a | |
* prior clear_event_queue() in order to allow bbss_buffer_counts to pass an | |
* assert during the restore process. | |
*/ | |
/** First call to return the information needed to make the other calls. Returns | |
* a pointer used by the other methods. Caller is reponsible for freeing (using | |
* free() and not delete []) the returned gids and sizes arrays when finished. | |
* The sizes array and global_size are needed for the caller to construct | |
* proper buffer sizes to pass to bbss_save_global and bbss_save for filling | |
* in. The size of these arrays is returned in *len. They are not needed for | |
* restoring (since the caller is passing already filled in buffers that are | |
* read by bbss_restore_global and bbss_restore. The gids returned are base | |
* gids. It is the callers responsibility to somehow concatenate buffers with | |
* the same gid (from different hosts) either after save or before restore and | |
* preserve the piece count of the number of concatenated buffers for each base | |
* gid. Global_size will only be non_zero for host 0. | |
*/ | |
void* bbss_buffer_counts(int* len, int** gids, int** sizes, int* global_size); | |
/** Call only on host 0 with a buffer of size equal to the global_size returned | |
* from the bbss_buffer_counts call on host 0 sz is the size of the buffer | |
* (for error checking only, buffer+sz is out of bounds) | |
*/ | |
void bbss_save_global(void* bbss, char* buffer, int sz); | |
/** Call on all hosts with the buffer contents returned from the call to | |
* bbss_save_global. This must be called prior to any calls to bbss_restore sz | |
* is the size of the buffer (error checking only). This also does some other | |
* important restore initializations. | |
*/ | |
void bbss_restore_global(void* bbss, char* buffer, int sz); | |
/** Call this for each item of the gids from bbss_buffer_counts along with a | |
* buffer of size from the corresponding sizes array. The buffer will be filled | |
* in with savestate information. The gid may be the same on different hosts, | |
* in which case it is the callers responsibility to concatentate buffers at | |
* some point to allow calling of bbss_restore. sz is the size of the buffer | |
* (error checking only). | |
*/ | |
void bbss_save(void* bbss, int gid, char* buffer, int sz); | |
/** Call this for each item of the gids from bbss_buffer_counts, the number of | |
* buffers that were concatenated for the gid, and the concatenated buffer (the | |
* concatenated buffer does NOT contain npiece as the first value in the char* | |
* buffer pointer). sz is the size of the buffer (error checking only). | |
*/ | |
void bbss_restore(void* bbss, int gid, int npiece, char* buffer, int sz); | |
/** At the end of the save process, call this to cleanup. When this call | |
* returns, bbss will be invalid. | |
*/ | |
void bbss_save_done(void* bbss); | |
/** At the end of the restore process, call this to do some extra setting up and | |
* cleanup. When this call returns, bbss will be invalid. | |
*/ | |
void bbss_restore_done(void* bbss); |
Line 12 in f4290eb
#include "bbsavestate.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, will keep an eye out when updating #1597 after merging this one.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1811 +/- ##
=======================================
Coverage 45.45% 45.45%
=======================================
Files 550 550
Lines 113130 113130
=======================================
Hits 51423 51423
Misses 61707 61707 ☔ View full report in Codecov by Sentry. |
In the context of C/C++ MOD compatibility across different versions, the aim is to have as much as possible all NRN "API" in headers so to as not having to declare them in the VERBATIM blocks.
Also #1805 changed
nrn_mallinfo
signature to returnstd::size_t