Add page cloning
parent
6bfa43da67
commit
918a2a0192
|
@ -104,6 +104,15 @@ YDB_PageSize ydb_page_row_count_get(YDB_TablePage* page);
|
|||
*/
|
||||
void ydb_page_row_count_set(YDB_TablePage* page, YDB_PageSize row_count);
|
||||
|
||||
/**
|
||||
* @brief Clone a page.
|
||||
* @param page A page to clone.
|
||||
* @return A cloned page.
|
||||
*
|
||||
* Notice that you should deallocate it with ydb_page_free().
|
||||
*/
|
||||
YDB_TablePage* ydb_page_clone(const YDB_TablePage* page);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
|
@ -115,6 +115,12 @@ void ydb_page_row_count_set(YDB_TablePage *page, YDB_PageSize row_count) {
|
|||
page->row_count = row_count;
|
||||
}
|
||||
|
||||
YDB_TablePage *ydb_page_clone(const YDB_TablePage *page) {
|
||||
YDB_TablePage* result = malloc(sizeof(YDB_TablePage));
|
||||
memcpy(result, page, sizeof(YDB_TablePage));
|
||||
return result;
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue