3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2026-04-28 14:53:36 +00:00

Fix memory and concurrency issues in OCaml API (#6992)

* Fix memory and concurrency issues in OCaml API

* Undo locking changes
This commit is contained in:
Christoph M. Wintersteiger 2023-11-17 02:28:12 +00:00 committed by GitHub
parent 5b9fdcf462
commit 36382ccb57
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 41 additions and 19 deletions

View file

@ -2,6 +2,12 @@
#include <string.h>
#include <assert.h>
#ifndef __STDC_NO_ATOMICS__
#include <stdatomic.h>
#else
#define _Atomic(T) T
#endif
#ifdef __cplusplus
extern "C" {
#endif
@ -118,7 +124,7 @@ int compare_pointers(void* pt1, void* pt2) {
blocks that get copied. */
typedef struct {
Z3_context ctx;
unsigned long obj_count;
_Atomic(unsigned long) obj_count;
} Z3_context_plus_data;
/* A context is wrapped to an OCaml value by storing a pointer