ADT
        ast-experimental
        pthread-emulation
        qualifiedEnum
      
      
        
          | Last change
 on this file since d8075d28 was             0f781fb8, checked in by Michael Brooks <mlbrooks@…>, 4 years ago | 
        
          | 
Refactoring of string internals.  Existing tests pass.
 
Adding tracking for multiple string heaps, or "scratchpads."Cases of allocating across different pad contexts aren't implemented yet.
 Adding basic controls to manage these contexts, which lead to expected assertion failures
 at unimplemented cases.
 
 | 
        
          | 
              
Property                 mode
 set to                 100644 | 
        
          | File size:
            1.3 KB | 
      
      
| Rev | Line |  | 
|---|
| [0f781fb8] | 1 | // | 
|---|
|  | 2 | // Cforall Version 1.0.0 Copyright (C) 2016 University of Waterloo | 
|---|
|  | 3 | // | 
|---|
|  | 4 | // The contents of this file are covered under the licence agreement in the | 
|---|
|  | 5 | // file "LICENCE" distributed with Cforall. | 
|---|
|  | 6 | // | 
|---|
|  | 7 | // string_sharectx -- utility for controlling string sharing / isolation | 
|---|
|  | 8 | // | 
|---|
|  | 9 | // Author           : Michael L. Brooks | 
|---|
|  | 10 | // Created On       : Fri Sep 03 11:00:00 2021 | 
|---|
|  | 11 | // Last Modified By : Michael L. Brooks | 
|---|
|  | 12 | // Last Modified On : Fri Sep 03 11:00:00 2021 | 
|---|
|  | 13 | // Update Count     : 1 | 
|---|
|  | 14 | // | 
|---|
|  | 15 |  | 
|---|
|  | 16 | #pragma once | 
|---|
|  | 17 |  | 
|---|
|  | 18 | //######################### String Sharing Context ######################### | 
|---|
|  | 19 |  | 
|---|
|  | 20 | struct VbyteHeap; | 
|---|
|  | 21 |  | 
|---|
|  | 22 | // A string_sharectx | 
|---|
|  | 23 | // | 
|---|
|  | 24 | // Usage: | 
|---|
|  | 25 | // void bar() { | 
|---|
|  | 26 | //    c(); | 
|---|
|  | 27 | //    string_sharectx c = {NEW_SHARING}; | 
|---|
|  | 28 | //    d(); | 
|---|
|  | 29 | // } | 
|---|
|  | 30 | // void foo() { | 
|---|
|  | 31 | //    a(); | 
|---|
|  | 32 | //    string_sharectx c = {NO_SHARING}; | 
|---|
|  | 33 | //    b(); | 
|---|
|  | 34 | //    bar(); | 
|---|
|  | 35 | //    e(); | 
|---|
|  | 36 | // } | 
|---|
|  | 37 | // int main() { | 
|---|
|  | 38 | //    foo(); | 
|---|
|  | 39 | // } | 
|---|
|  | 40 | // | 
|---|
|  | 41 | // a, d: share string character ranges within themselves, not with each other | 
|---|
|  | 42 | // b, c, e: never share anything | 
|---|
|  | 43 | // | 
|---|
|  | 44 | struct string_sharectx { | 
|---|
|  | 45 | // private | 
|---|
|  | 46 | VbyteHeap * activeHeap; | 
|---|
|  | 47 | string_sharectx * older; | 
|---|
|  | 48 | }; | 
|---|
|  | 49 |  | 
|---|
|  | 50 | enum StringSharectx_Mode { NEW_SHARING, NO_SHARING }; | 
|---|
|  | 51 |  | 
|---|
|  | 52 | void ?{}( string_sharectx &, StringSharectx_Mode ); | 
|---|
|  | 53 | void ^?{}( string_sharectx & ); | 
|---|
|  | 54 |  | 
|---|
|  | 55 | void ?{}( string_sharectx & ) = void; | 
|---|
|  | 56 | void ?{}( string_sharectx &, string_sharectx ) = void; | 
|---|
|  | 57 | void ?=?( string_sharectx &, string_sharectx ) = void; | 
|---|
|  | 58 |  | 
|---|
       
      
  Note:
 See   
TracBrowser
 for help on using the repository browser.