Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

ABCL

Name: Anonymous 2011-12-31 4:41

ENTERPRISE CODE SNIPITS


package org.armedbear.lisp;

import static org.armedbear.lisp.Lisp.*;

// ### gc
public final class gc extends Primitive
{
    private gc()
    {
        super("gc", PACKAGE_EXT);
    }

    @Override
    public LispObject execute()
    {
        Runtime runtime = Runtime.getRuntime();
        long free = 0;
        long maxFree = 0;
        while (true) {
            try {
                runtime.gc();
                Thread.sleep(100);
                runtime.runFinalization();
                Thread.sleep(100);
                runtime.gc();
                Thread.sleep(100);
            }
            catch (InterruptedException e) {}
            free = runtime.freeMemory();
            if (free > maxFree)
                maxFree = free;
            else
                break;
        }
        return number(free);
    }

    private static final Primitive GC = new gc();
}



  @Override
  public LispObject execute(LispObject arg)
  {
    if (minArgs == 1)
      {
        return bindParametersAndExecute(arg);
      }
    else
      {
        return invokeArrayExecute(arg);
      }
  }

  @Override
  public LispObject execute(LispObject first, LispObject second)

  {
    if (minArgs == 2)
      {
        return bindParametersAndExecute(first, second);
      }
    else
      {
        return invokeArrayExecute(first, second);
      }
  }

  @Override
  public LispObject execute(LispObject first, LispObject second,
                            LispObject third)

  {
    if (minArgs == 3)
      {
        return bindParametersAndExecute(first, second, third);
      }
    else
      {
        return invokeArrayExecute(first, second, third);
      }
  }

  @Override
  public LispObject execute(LispObject first, LispObject second,
                            LispObject third, LispObject fourth)

  {
    if (minArgs == 4)
      {
        return bindParametersAndExecute(first, second, third, fourth);
      }
    else
      {
        return invokeArrayExecute(first, second, third, fourth);
      }
  }

  @Override
  public LispObject execute(LispObject first, LispObject second,
                            LispObject third, LispObject fourth,
                            LispObject fifth)

  {
    if (minArgs == 5)
      {
        return bindParametersAndExecute(first, second, third, fourth,
                                        fifth);
      }
    else
      {
        return invokeArrayExecute(first, second, third, fourth, fifth);
      }
  }

  @Override
  public LispObject execute(LispObject first, LispObject second,
                            LispObject third, LispObject fourth,
                            LispObject fifth, LispObject sixth)

  {
    if (minArgs == 6)
      {
        return bindParametersAndExecute(first, second, third, fourth,
                                        fifth, sixth);
      }
    else
      {
        return invokeArrayExecute(first, second, third, fourth, fifth,
                                  sixth);
      }
  }

  @Override
  public LispObject execute(LispObject first, LispObject second,
                            LispObject third, LispObject fourth,
                            LispObject fifth, LispObject sixth,
                            LispObject seventh)

  {
    if (minArgs == 7)
      {
        return bindParametersAndExecute(first, second, third, fourth,
                               fifth, sixth, seventh);
      }
    else
      {
        return invokeArrayExecute(first, second, third, fourth, fifth,
                                  sixth, seventh);
      }
  }

  @Override
  public LispObject execute(LispObject first, LispObject second,
                            LispObject third, LispObject fourth,
                            LispObject fifth, LispObject sixth,
                            LispObject seventh, LispObject eighth)

  {
    if (minArgs == 8)
      {
        return bindParametersAndExecute(first, second, third, fourth,
                               fifth, sixth, seventh, eighth);
      }
    else
      {
        return invokeArrayExecute(first, second, third, fourth, fifth,
                                  sixth, seventh, eighth);
      }
  }

Name: Anonymous 2011-12-31 6:52

wowee

Name: Anonymous 2011-12-31 7:33

First one is just to keep the gc recycling as soon as possible rather than wait like it normally does until you're fucked.

That second one reminds me of some java shit i once saw where the person made a method for creating an array with X objects and he made giant list of methods for X = 1 to like 20 +

Name: Anonymous 2011-12-31 7:45

>>3
Invoking the GC every 200 milliseconds is a sure fire way to remove performance due to the overhead.

Name: Anonymous 2011-12-31 10:47

>>3
>made a method for creating an array with X objects and he made giant list of methods for X = 1 to like 20 +

That's just fucking horrible.

Name: Anonymous 2011-12-31 12:18

namespace Scalable {
        class Enterprise {
                public void Solution()
                {
                        Console.WriteLine("[b][i][o][u][sup]SCALABLE[/sup] ENTERPRISE [sub]SOLUTION[/sub][/u][/o][/i][/b]");
                }
        }
}

Output:
SCALABLE ENTERPRISE SOLUTION

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List