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:
parent
5b9fdcf462
commit
36382ccb57
4 changed files with 41 additions and 19 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue