Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Update .cabal, add epicMemInfo

darcs-hash:20090426155020-6ac22-53eaddd27b9dedf3306290e8eebc32ee17b111bd.gz
  • Loading branch information...
commit 5fe6bd79dfe8a706e5a6e7f8db4994dc4b685a93 1 parent 46e1f29
eb authored
Showing with 28 additions and 2 deletions.
  1. +3 −0  Makefile
  2. +11 −2 epic.cabal
  3. +11 −0 evm/stdfuns.c
  4. +3 −0  evm/stdfuns.h
3  Makefile
View
@@ -5,6 +5,9 @@ GHCOPTS =
package: rts
runhaskell Setup.lhs build
+cabal-package:
+ runhaskell Setup.lhs sdist
+
configure:
runhaskell Setup.lhs configure --user --ghc --prefix=$(PREFIX)
cd Epic; echo "module Epic.Prefix where libprefix=\"$(PREFIX)\"" > Prefix.hs
13 epic.cabal
View
@@ -4,13 +4,22 @@ Author: Edwin Brady
License: BSD3
License-file: LICENSE
Maintainer: eb@dcs.st-and.ac.uk
-Homepage: http://www.dcs.st-and.ac.uk/~eb/
+Homepage: http://www.dcs.st-and.ac.uk/~eb/epic.php
Stability: experimental
+Category: Compilers/Interpreters
+Synopsis: Compiler for a supercombinator language
+Description: Epic is a simple functional language which compiles to
+ reasonably efficient C code, using the Boehm-Demers-Weiser
+ garbage collector. It is currently used as a back end for
+ the Idris dependently typed programming language.
+
Build-depends: base, haskell98, mtl, Cabal, array, directory
+Build-type: Simple
+
Extensions: MultiParamTypeClasses, FunctionalDependencies,
ExistentialQuantification, OverlappingInstances
-Synopsis: Compiler for Supercombinator language
Exposed-modules: Epic.Compiler
Other-modules: Epic.Bytecode Epic.Parser Epic.Scopecheck
Epic.Language Epic.Lexer Epic.CodegenC
Epic.Prefix Epic.OTTLang
+Extra-source-files: evm/*.c evm/*.h evm/Makefile
11 evm/stdfuns.c
View
@@ -8,6 +8,17 @@ void printInt(int x) { printf("%d\n",x); }
void putStr(char* s) { printf("%s",s); }
void printBigInt(mpz_t x) { printf("%s\n",mpz_get_str(NULL,10,x)); }
+void epicMemInfo() {
+ GC_gcollect();
+ int heap = GC_get_heap_size();
+ int free = GC_get_free_bytes();
+ int total = GC_get_total_bytes();
+
+ printf("Heap size %d\n", heap);
+ printf("Heap used %d\n", heap-free);
+ printf("Total allocations %d\n", total);
+}
+
int readInt() {
return atoi(readStr());
}
3  evm/stdfuns.h
View
@@ -19,6 +19,9 @@ void putStr(char* str);
void printInt(int x);
void printBigInt(mpz_t x);
+// dump memory usage (from libgc)
+void epicMemInfo();
+
int readInt();
char* readStr();
Please sign in to comment.
Something went wrong with that request. Please try again.