You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
390 B
20 lines
390 B
#ifndef _COW_H
|
|
#define _COW_H
|
|
|
|
#include <stdlib.h>
|
|
|
|
// Copy-on-write mapped memory.
|
|
typedef struct cow cow_t, *cow;
|
|
|
|
cow_t* cow_create(size_t size);
|
|
void cow_free(cow_t* restrict cow);
|
|
cow_t* cow_clone(const cow_t* cow);
|
|
|
|
int cow_is_fake(const cow_t* cow);
|
|
size_t cow_size(const cow_t* cow);
|
|
|
|
#define cow_ptr(v) (*((void**)(v)))
|
|
#define cow_ptr_of(t, v) (*((t **)(v)))
|
|
|
|
#endif /* _COW_H */
|