Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion M2/Macaulay2/bin/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

#include "M2mem.h"
#include "types.h"
#include "debug.h"

#include <engine.h> /* to get IM2_initialize() : */
#include "supervisorinterface.h"
Expand Down
1 change: 0 additions & 1 deletion M2/Macaulay2/d/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ set(CLIST
M2types.c M2lib.c M2mem.c types.h
scclib.c ../c/scc-core.h
memdebug.c memdebug.h
debug.c debug.h
getpagesize.h M2mem.h
gmp_aux.c gmp_aux.h
gdbm_interface.c
Expand Down
2 changes: 1 addition & 1 deletion M2/Macaulay2/d/M2lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

#include "M2mem.h"
#include "types.h"
#include "debug.h"
#include <interface/m2-mem.h>
#include "supervisorinterface.h"

#include <readline/readline.h>
Expand Down
52 changes: 1 addition & 51 deletions M2/Macaulay2/d/M2mem.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#include "types.h"
#include "M2mem.h"
#include "debug.h"
#include <interface/m2-mem.h>

#ifdef MEMDEBUG
#include <memdebug.h>
Expand Down Expand Up @@ -95,56 +95,6 @@ char *getmoremem_atomic (char *s, size_t old, size_t new) {
return p;
}

/* Valgrind helper functions */
#ifndef NVALGRIND

void *I_WRAP_SONAME_FNNAME_ZU(libgcZdsoZd1,GC_malloc)(size_t s){
long result;
OrigFn fn;
VALGRIND_GET_ORIG_FN(fn);
CALL_FN_W_W(result,fn,s);
VALGRIND_MAKE_MEM_DEFINED(&result,sizeof(result));
return (void*)result;
}

void *I_WRAP_SONAME_FNNAME_ZU(libgcZdsoZd1,GC_malloc_atomic)(size_t s){
long result;
OrigFn fn;
VALGRIND_GET_ORIG_FN(fn);
CALL_FN_W_W(result,fn,s);
VALGRIND_MAKE_MEM_DEFINED(&result,sizeof(result));
return (void*)result;
}

void *I_WRAP_SONAME_FNNAME_ZU(libgcZdsoZd1,GC_malloc_ignore_off_page)(size_t s){
long result;
OrigFn fn;
VALGRIND_GET_ORIG_FN(fn);
CALL_FN_W_W(result,fn,s);
VALGRIND_MAKE_MEM_DEFINED(&result,sizeof(result));
return (void*)result;
}

void *I_WRAP_SONAME_FNNAME_ZU(libgcZdsoZd1,GC_malloc_atomic_ignore_off_page)(size_t s){
long result;
OrigFn fn;
VALGRIND_GET_ORIG_FN(fn);
CALL_FN_W_W(result,fn,s);
VALGRIND_MAKE_MEM_DEFINED(&result,sizeof(result));
return (void*)result;
}

void *I_WRAP_SONAME_FNNAME_ZU(libgcZdsoZd1,GC_realloc)(void *p, size_t s){
long result;
OrigFn fn;
VALGRIND_GET_ORIG_FN(fn);
CALL_FN_W_WW(result,fn,(long)p,s);
VALGRIND_MAKE_MEM_DEFINED(&result,sizeof(result));
return (void*)result;
}

#endif /* NVALGRIND */

/*
Local Variables:
compile-command: "echo \"make: Entering directory \\`$M2BUILDDIR/Macaulay2/d'\" && make -C $M2BUILDDIR/Macaulay2/d "
Expand Down
12 changes: 2 additions & 10 deletions M2/Macaulay2/d/Makefile.files.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,13 @@ M2_OPTCFILES :=
M2_EXTRACFILES :=
M2_MADECFILES :=
M2_SRCFILES :=
M2_OPTCFILES += debug.c
ifeq "@DEBUG@" "yes"
M2_OBJECTS += debug.o
endif
M2_CFILES += gmp_aux.c
M2_LASTCFILES += M2types.c scclib.c M2lib.c M2mem.c gdbm_interface.c memdebug.c
M2_MADECFILES := startup.c
M2_OBJECTS += $(M2_MADECFILES:.c=.o)
M2_CCFILES := boost-regex.cpp main.cpp
M2_OBJECTS += $(M2_CCFILES:.cpp=.o)
M2_HFILES := getpagesize.h types.h M2mem.h debug.h startup-header.h startup-trailer.h memdebug.h
M2_HFILES := getpagesize.h types.h M2mem.h startup-header.h startup-trailer.h memdebug.h

M2_DFILES :=
M2_DFILES += arithmetic.d
Expand Down Expand Up @@ -120,7 +116,6 @@ actors5.o basic.o : \
@srcdir@/../e/engine.h \
@srcdir@/../e/newdelete.hpp \
@srcdir@/../d/M2mem.h \
@srcdir@/../d/debug.h \
../../include/M2/config.h

interface2.o : \
Expand All @@ -132,16 +127,14 @@ interface2.o : \
@srcdir@/../system/supervisorinterface.h \
@srcdir@/../e/engine.h \
@srcdir@/../e/engine-includes.hpp \
@srcdir@/../d/M2mem.h \
@srcdir@/../d/debug.h
@srcdir@/../d/M2mem.h

interface.o : \
../../include/M2/config.h \
@srcdir@/../system/mutex.h \
@srcdir@/../e/newdelete.hpp \
@srcdir@/../d/M2mem.h \
@srcdir@/../c/scc-core.h \
@srcdir@/../d/debug.h \
@srcdir@/../system/supervisorinterface.h \
@srcdir@/../e/engine.h \
@srcdir@/../e/engine-includes.hpp \
Expand Down Expand Up @@ -229,7 +222,6 @@ engine.o : \
@srcdir@/../c/scc-core.h \
@srcdir@/../../include/M2/gc-include.h \
@srcdir@/../c/scc-core.h \
@srcdir@/../d/debug.h \
@srcdir@/../system/supervisorinterface.h \
@srcdir@/../e/error.h \
@srcdir@/../e/exceptions.hpp \
Expand Down
8 changes: 3 additions & 5 deletions M2/Macaulay2/d/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,6 @@ LIBFILES :=

# to get getmem
LIBFILES += M2mem.o
# to get trapchk()
LIBFILES += debug.o
LIBFILES += gmp_aux.o arithmetic.o atomic.o M2.o system.o strings.o varstrin.o errio.o vararray.o ctype.o nets.o varnets.o interrupts.o pthread0.o stdio.o stdiop.o err.o gmp.o
libd.a: $(LIBFILES) ; ar -r $@ $?
rm-libd.a:; rm libd.a
Expand Down Expand Up @@ -208,9 +206,9 @@ M2lib.o : M2_CFLAGS += -Wno-frame-address
endif

M2lib.o scclib.o : | interp-exports.h.tmp
scclib.o : expr-exports.h M2mem.h debug.h types.h ../c/compat.h ../e/engine.h
M2lib.o : types.h ../c/compat.c debug.h M2mem.h ../c/compat.h ../e/engine.h
M2lib.o scclib.o gdbm_interface.o gc_cpp.o debug.o : ../../include/M2/config.h
scclib.o : expr-exports.h M2mem.h types.h ../c/compat.h ../e/engine.h
M2lib.o : types.h ../c/compat.c M2mem.h ../c/compat.h ../e/engine.h
M2lib.o scclib.o gdbm_interface.o gc_cpp.o : ../../include/M2/config.h
M2.o : ../../include/M2/config.h @srcdir@/../c/scc-core.h

clean::; rm -f startup.c
Expand Down
9 changes: 5 additions & 4 deletions M2/Macaulay2/d/ctype.d
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,12 @@ ismathoperator(c1:char, c2:char):bool := (
ismathoperator((int(uchar(c1)) << 8) | int(uchar(c2))));

export isvalidsymbol(s:string):bool := (
if !isalpha(s.0) then return false;
if ismathoperator(s.0, s.1) && length(s) == utf8charlength(s.0)
n := length(s);
if n > 0 && !isalpha(s.0) then return false;
if n > 1 && ismathoperator(s.0, s.1) && n == utf8charlength(s.0)
then return true;
for i from 0 to length(s) - 1 do (
if !isalnum(s.i) || ismathoperator(s.i, s.(i + 1))
for i from 0 to n - 1 do (
if !isalnum(s.i) || (n > i + 1 && ismathoperator(s.i, s.(i + 1)))
then return false);
true);

Expand Down
47 changes: 0 additions & 47 deletions M2/Macaulay2/d/debug.c

This file was deleted.

26 changes: 0 additions & 26 deletions M2/Macaulay2/d/debug.h

This file was deleted.

2 changes: 1 addition & 1 deletion M2/Macaulay2/d/scclib.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include "types.h"
#include "M2mem.h"
#include "../c/compat.c"
#include "debug.h"
#include <interface/m2-mem.h>

#include "../system/supervisorinterface.h"

Expand Down