Browse Source

Bug 2209 - Nyquist: Audacity crashes when running seq-write-smf

Used upstream fix instead.  Really need to update to Nyquist
release 3.16 for many more 64-bit fixes/enhancements.
au-ny-api
Leland Lucius 1 year ago
parent
commit
428193920f
  1. 22
      lib-src/libnyquist/nyquist/cmt/mem.c
  2. 2
      src/Tags.cpp

22
lib-src/libnyquist/nyquist/cmt/mem.c

@ -9,6 +9,7 @@
*/
/* CHANGE LOG
----------------------------------------------------------------------
10-Oct-20 | RBD : change to 8-byte alignment
28-Apr-03 | DM : fix #includes for portability
----------------------------------------------------------------------
*/
@ -24,16 +25,16 @@
/* how many bytes in the largest node managed in mem_free_list array */
#define MAX_SIZE_FOR_FREELIST 256
intptr_t *mem_free_list[MAX_SIZE_FOR_FREELIST/4];
intptr_t *mem_free_list[MAX_SIZE_FOR_FREELIST/8];
#define MEM_CHUNK_SIZE 4096
char *mem_chunk;
long mem_chunk_remaining = 0;
intptr_t mem_chunk_remaining = 0;
void meminit()
{
int i;
for (i = 0; i < MAX_SIZE_FOR_FREELIST/4; i++) {
for (i = 0; i < MAX_SIZE_FOR_FREELIST/8; i++) {
mem_free_list[i] = NULL;
}
}
@ -45,15 +46,16 @@ void *memget(register size_t size)
/* gprintf(TRANS, "memget calling MALLOC\n"); */
return MALLOC(size);
} else {
intptr_t **p = mem_free_list + ((size - 1) >> 2);
/* 8 -> 0, 9 -> 1, 256 -> 31 */
intptr_t **p = mem_free_list + ((size - 1) >> 3);
if (*p) {
register intptr_t *result = *p;
intptr_t *result = *p;
*p = (intptr_t *) *result;
/* gprintf(TRANS, "memget->%lx\n", result); */
return (char *) result;
} else if ((size_t) mem_chunk_remaining >= size) {
register char *result = mem_chunk;
size = (size + 3) & ~3; /* round up to multiple of 4 */
char *result = mem_chunk;
size = (size + 7) & ~7; /* round up to multiple of 8 */
mem_chunk += size;
mem_chunk_remaining -= size;
/* gprintf(TRANS, "memget->%lx\n", result); */
@ -62,7 +64,7 @@ void *memget(register size_t size)
} else if ((mem_chunk = (char *) MALLOC(MEM_CHUNK_SIZE))) {
register char *result = mem_chunk;
/* gprintf(TRANS, "mem_chunk at %lx\n", mem_chunk); */
size = (size + 3) & ~3; /* round up to multiple of 4 */
size = (size + 7) & ~7; /* round up to multiple of 8 */
mem_chunk += size;
mem_chunk_remaining = MEM_CHUNK_SIZE - size;
/* gprintf(TRANS, "memget->%lx\n", result); */
@ -76,11 +78,11 @@ void *memget(register size_t size)
void memfree(register void *ptr, register size_t size)
{
register intptr_t **p = (intptr_t **) ptr;
intptr_t **p = (intptr_t **) ptr;
if (size > MAX_SIZE_FOR_FREELIST) {
FREE(ptr);
} else {
register intptr_t **head_ptr = mem_free_list + ((size - 1) >> 2);
intptr_t **head_ptr = mem_free_list + ((size - 1) >> 3);
*p = *head_ptr;
*head_ptr = (intptr_t *) p;
}

2
src/Tags.cpp

@ -834,7 +834,7 @@ TagsEditorDialog::TagsEditorDialog(wxWindow * parent,
if (IsWindowRectValid(&r))
Move(r.GetPosition());
SetSize(r.GetSize());
//SetSize(r.GetSize());
Layout();
// Resize value column width based on width of columns and the vertical scrollbar

Loading…
Cancel
Save