diff --git a/include/cow.h b/include/cow.h index 9472a66..4893973 100644 --- a/include/cow.h +++ b/include/cow.h @@ -8,7 +8,7 @@ extern "C" { #include -enum cow_err { +enum cow_err_kind { COW_ERR_UNKNOWN =0, COW_ERR_NONE =1, // Success @@ -43,7 +43,7 @@ static inline #ifdef _COW_NO_ASSUME_ABI #define _cow_size_unsafe(v) cow_size(v) #else -// XXX: This macro is *VERY* ABI sensitive. This shouldn't be used if the ABI has changed since the build of libcow's `cow_t.h` passed its static assertions in *both* the C and C++ implementations. +// XXX: This macro is *VERY* ABI sensitive. This shouldn't be used if the ABI has changed since the build of libcow's `cow_t.h` passed its stati assertions in *both* the C and C++ implementations. // The C++ API uses this by default for its `Cow::size()` function. #define _cow_size_unsafe(v) (*(((size_t*)(v))+1)) __attribute__((deprecated("size() is safer and offers better codegen."))) diff --git a/src/cow.c b/src/cow.c index b9c0f56..aec3563 100644 --- a/src/cow.c +++ b/src/cow.c @@ -92,7 +92,8 @@ size_t cow_size(const cow_t* cow) inline internal cow_t _cow_create_unboxed(size_t size) { cow_t ret; - ret.error = COW_POISON_NONE; + + //ret.error = COW_POISON_NONE; ret.size = size; ret.fd = shm_fd(size); ret.origin = mmap(NULL, size, PROT_READ|PROT_WRITE, MAP_SHARED, ret.fd, 0); @@ -124,7 +125,7 @@ cow_t* cow_clone(const cow_t* cow) { cow_t clone; - clone.error = COW_POISON_NONE; + //clone.error = COW_POISON_NONE; clone.origin = mmap(cow->origin, cow->size, PROT_READ|PROT_WRITE, MAP_PRIVATE, cow_real_fd(cow), 0); if(clone.origin == MAP_FAILED) die("cow_clone:mmap"); clone.fd = (~INT_MAX) | cow->fd; diff --git a/src/cow_t.h b/src/cow_t.h index f16f715..0865207 100644 --- a/src/cow_t.h +++ b/src/cow_t.h @@ -20,9 +20,6 @@ struct cow_mapped_slice { size_t size; // Should be at this offset. int fd; // Will be ORd with ~INT_MAX if it's a clone. Will be >0 if it's the original. - - // Error status - union poison error; }; // cow_t, *cow #ifdef __cplusplus diff --git a/src/error.c b/src/error.c deleted file mode 100644 index 7ec51d3..0000000 --- a/src/error.c +++ /dev/null @@ -1,13 +0,0 @@ -#include "error.h" - -internal void _cow_poison(cow_t* restrict cow, enum cow_err kind, const char *msg) -{ - if(cow->error.e_global) { - - } -} - -internal void _cow_poison_ref(cow_t* restrict cow, cow_error* globl) -{ - -} diff --git a/src/error.h b/src/error.h index da700fc..eb22bf2 100644 --- a/src/error.h +++ b/src/error.h @@ -12,6 +12,8 @@ extern "C" { #define restrict __restrict__ #endif +/* +Failed: typedef struct cow_error cow_error; union poison { struct cow_error { @@ -31,6 +33,7 @@ union poison { void _cow_poison(cow_t* restrict cow, enum cow_err kind, const char *msg) internal; void _cow_poison_ref(cow_t* restrict cow, cow_error* globl) internal; +*/ #ifdef __cplusplus }