Changeset: 2f350cfbdd63 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=2f350cfbdd63
Modified Files:
gdk/gdk_system.h
Branch: Jul2017
Log Message:
When destroying a lock, only remove it from the list, don't add copy.
diffs (29 lines):
diff --git a/gdk/gdk_system.h b/gdk/gdk_system.h
--- a/gdk/gdk_system.h
+++ b/gdk/gdk_system.h
@@ -224,20 +224,13 @@ gdk_export ATOMIC_TYPE volatile GDKlocks
/* since the lock is in memory that is governed by the */ \
/* SQL storage allocator, and hence we have no control */ \
/* over when the lock is destroyed and the memory freed */ \
- if (0 && strncmp((l)->name, "sa_", 3) != 0) { \
- MT_Lock * volatile _p; \
- /* save a copy for statistical purposes */ \
- _p = GDKmalloc(sizeof(MT_Lock)); \
+ if (strncmp((l)->name, "sa_", 3) != 0) { \
+ MT_Lock * volatile *_p; \
while (ATOMIC_TAS(GDKlocklistlock, dummy) != 0) \
; \
- if (_p) { \
- memcpy(_p, l, sizeof(MT_Lock)); \
- _p->next = GDKlocklist; \
- GDKlocklist = _p; \
- } \
- for (_p = GDKlocklist; _p; _p = _p->next) \
- if (_p->next == (l)) { \
- _p->next = (l)->next; \
+ for (_p = &GDKlocklist; *_p; _p = &(*_p)->next) \
+ if ((l) == *_p) { \
+ *_p = (l)->next; \
break; \
} \
ATOMIC_CLEAR(GDKlocklistlock, dummy); \
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list