Skip to content

Commit

Permalink
Pack bools in Variable in memory
Browse files Browse the repository at this point in the history
  • Loading branch information
sorear committed Sep 13, 2010
1 parent 0c06bec commit bde27dd
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/Kernel.cs
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Threading;
using System.Runtime.InteropServices;
namespace Niecza {
// We like to reuse continuation objects for speed - every function only
// creates one kind of continuation, but tweaks a field for exact return
Expand Down Expand Up @@ -115,17 +116,18 @@ public abstract class IP6 {
// object, but !islist. Read only.
//
// Scalar->list: bind islist, must be Iterable. Bind it same rwness.
[StructLayout(LayoutKind.Sequential, Pack = 1)]
public class Variable {
public bool bvalue;
public bool rw;
public bool islist;
// If non-null, then this lv is, or at one time was, the result of
// an autovivifying access, but has not yet committed to becoming
// real or becoming undef. We call these virtual containers; they
// exist only in flight (resultSlots) and in parcel contexts.
public IP6 whence;
public IP6 container;
// will be a direct ref if !rw; lists are always !rw
public bool bvalue;
public bool rw;
public bool islist;

public Variable(bool bvalue, bool rw, bool islist, IP6 whence,
IP6 container) {
Expand Down

0 comments on commit bde27dd

Please sign in to comment.