22 #include <sys/types.h> 25 #include <netinet/in.h> 72 time_t starttime = time (0);
73 char *datestring = ctime (&starttime);
96 demo1->
name =
format (0,
"My name is Ishmael%c", 0);
109 demo1, sizeof (demo1));
115 demo2 = demo1->
demo2;
117 fformat (stdout,
"demo2 location: %llx\n", demo2);
134 demo1->
demo2 = demo2;
163 time_t starttime = time (0);
164 char *datestring = ctime (&starttime);
178 demo1->
demo2 = demo2;
179 demo1->
name =
format (0,
"My name is Ishmael%c", 0);
190 checkpoint, sizeof (
u8));
204 demo2 = demo1->
demo2;
206 fformat (stdout,
"demo2 location: %llx\n", demo2);
222 pm->
c = svmdb_map_chroot_size (
"/ptest", 4 << 20);
232 else if (
unformat (input,
"serialize"))
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment) ...
static void svm_pop_heap(void *oldheap)
void * svmdb_local_get_variable_reference(svmdb_client_t *client, svmdb_namespace_t namespace, char *var)
Fixed length block allocator.
void unserialize_demo1(serialize_main_t *sm, va_list *args)
clib_error_t * persist_malloc(persist_main_t *pm)
#define clib_error_report(e)
void svmdb_unmap(svmdb_client_t *client)
void unserialize_open_data(serialize_main_t *m, u8 *data, uword n_data_bytes)
static void * svm_push_data_heap(svm_region_t *rp)
void unserialize_cstring(serialize_main_t *m, char **s)
clib_error_t * serialize(serialize_main_t *m,...)
void serialize_open_vector(serialize_main_t *m, u8 *vector)
#define vec_free(V)
Free vector's memory (no header).
void svmdb_local_set_vec_variable(svmdb_client_t *client, char *var, void *val_arg, u32 elsize)
clib_error_t * persist_serialize(persist_main_t *pm)
Bitmaps built as vectors of machine words.
clib_error_t * unserialize(serialize_main_t *m,...)
static void * clib_mem_alloc(uword size)
void serialize_cstring(serialize_main_t *m, char *s)
void serialize_demo1(serialize_main_t *sm, va_list *args)
int main(int argc, char **argv)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
persist_main_t persist_main
void * svmdb_local_get_vec_variable(svmdb_client_t *client, char *var, u32 elsize)
void * serialize_close_vector(serialize_main_t *m)
#define clib_error_return(e, args...)
CLIB vectors are ubiquitous dynamically resized arrays with by user defined "headers".