File: nyquist.patch

package info (click to toggle)
audacity 2.1.2-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 86,844 kB
  • sloc: ansic: 225,005; cpp: 221,240; sh: 27,327; python: 16,896; makefile: 8,186; lisp: 8,002; perl: 317; xml: 307; sed: 16
file content (97 lines) | stat: -rw-r--r-- 3,458 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
Index: nyquist/nyqsrc/sound.c
===================================================================
RCS file: /cvsroot/audacity/lib-src/libnyquist/nyquist/nyqsrc/sound.c,v
retrieving revision 1.4
diff -u -r1.4 sound.c
--- nyquist/nyqsrc/sound.c	5 Mar 2009 16:34:00 -0000	1.4
+++ nyquist/nyqsrc/sound.c	5 Mar 2009 16:55:56 -0000
@@ -506,33 +506,39 @@
 void snd_list_unref(snd_list_type list)
 {
     void (*freefunc)();
+    snd_list_type next;
 
-    if (list == NULL || list == zero_snd_list) {
-        if (list == NULL)
+    while (list != zero_snd_list) {
+        if (list == NULL) {
            nyquist_printf("why did snd_list_unref get %p?\n", list);
-        return;
-    }
-    list->refcnt--;
-/*    nyquist_printf("snd_list_unref "); print_snd_list_type(list); stdputstr("\n"); */
-    if (list->refcnt == 0) {
-        if (list->block && list->block != zero_block) {
-            /* there is a next snd_list */
-/*          stdputstr("["); */
-            sample_block_unref(list->block);
-/*          stdputstr("]"); */
-            snd_list_unref(list->u.next);
+           return;
         }
-        else if (list->block == NULL) { /* the next thing is the susp */
-            /* free suspension structure */
-            /* nyquist_printf("freeing susp@%p\n", list->u.susp); */
-            freefunc = list->u.susp->free;
-            (*freefunc)(list->u.susp);
+        next = zero_snd_list;
+
+        list->refcnt--;
+/*      nyquist_printf("snd_list_unref "); print_snd_list_type(list); stdputstr("\n"); */
+        if (list->refcnt == 0) {
+            if (list->block && list->block != zero_block) {
+                /* there is a next snd_list */
+/*              stdputstr("["); */
+                sample_block_unref(list->block);
+/*              stdputstr("]"); */
+                next = list->u.next;
+            }
+            else if (list->block == NULL) { /* the next thing is the susp */
+                /* free suspension structure */
+                /* nyquist_printf("freeing susp@%p\n", list->u.susp); */
+                freefunc = list->u.susp->free;
+                (*freefunc)(list->u.susp);
+            }
+            /* nyquist_printf("freeing snd_list@%p\n", list); */
+            //DBY
+            if (list == list_watch) printf("freeing watched snd_list %p\n", list);
+            //DBY
+            ffree_snd_list(list, "snd_list_unref");
         }
-        /* nyquist_printf("freeing snd_list@%p\n", list); */
-        //DBY
-        if (list == list_watch) printf("freeing watched snd_list %p\n", list);
-        //DBY
-        ffree_snd_list(list, "snd_list_unref");
+
+        list = next;
     }
 }
 
Index: nyquist/xlisp/xldmem.c
===================================================================
RCS file: /cvsroot/audacity/lib-src/libnyquist/nyquist/xlisp/xldmem.c,v
retrieving revision 1.3
diff -u -r1.3 xldmem.c
--- nyquist/xlisp/xldmem.c	5 Mar 2009 16:34:00 -0000	1.3
+++ nyquist/xlisp/xldmem.c	5 Mar 2009 16:56:12 -0000
@@ -299,8 +299,6 @@
 LOCAL void findmem(void)
 {
     gc();
-    if (nfree < (long)anodes)
-        addseg();
 }
 
 /* gc - garbage collect (only called here and in xlimage.c) */
@@ -346,6 +344,10 @@
     /* count the gc call */
     ++gccalls;
 
+    /* add a new segment if still no free nodes */
+    if (nfree < (long)anodes)
+        addseg();
+
     /* call the *gc-hook* if necessary */
     if (s_gchook && (fun = getvalue(s_gchook))) {
         newfp = xlsp;