Changeset 1733184


Ignore:
Timestamp:
Nov 15, 2021, 4:26:56 PM (7 months ago)
Author:
Michael Brooks <mlbrooks@…>
Branches:
enum, master
Children:
01db301
Parents:
4e8df745
Message:

Fixing LL API not allowing simple assignment.
Removing accidentally commited performance regression of attribute-no-inline.

Location:
libcfa/src/containers
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/containers/string_res.cfa

    r4e8df745 r1733184  
    390390}
    391391
    392 static void assign_(string_res &this, const char* buffer, size_t bsize, const string_res & valSrc) {
     392static string_res & assign_(string_res &this, const char* buffer, size_t bsize, const string_res & valSrc) {
    393393
    394394    // traverse the incumbent share-edit set (SES) to recover the range of a base string to which `this` belongs
     
    478478            &pasting.Handle, bsize);
    479479    }
    480 }
    481 
    482 void assign(string_res &this, const char* buffer, size_t bsize) {
    483     assign_(this, buffer, bsize, *0p);
    484 }
    485 
    486 void ?=?(string_res &s, char other) {
    487     assign(s, &other, 1);
     480
     481    return this;
     482}
     483
     484string_res & assign(string_res &this, const char* buffer, size_t bsize) {
     485    return assign_(this, buffer, bsize, *0p);
     486}
     487
     488string_res & ?=?(string_res &s, char other) {
     489    return assign(s, &other, 1);
    488490}
    489491
    490492// Copy assignment operator
    491 void ?=?(string_res & this, const string_res & rhs) with( this ) {
    492     assign_(this, rhs.Handle.s, rhs.Handle.lnth, rhs);
    493 }
    494 
    495 void ?=?(string_res & this, string_res & rhs) with( this ) {
     493string_res & ?=?(string_res & this, const string_res & rhs) with( this ) {
     494    return assign_(this, rhs.Handle.s, rhs.Handle.lnth, rhs);
     495}
     496
     497string_res & ?=?(string_res & this, string_res & rhs) with( this ) {
    496498    const string_res & rhs2 = rhs;
    497     this = rhs2;
     499    return this = rhs2;
    498500}
    499501
     
    780782// allocation, the garbage collection routine is called.
    781783
    782 static char * __attribute__((noinline)) VbyteAlloc( VbyteHeap & this, int size ) with(this) {
     784static char * VbyteAlloc( VbyteHeap & this, int size ) with(this) {
    783785#ifdef VbyteDebug
    784786    serr | "enter:VbyteAlloc, size:" | size;
  • libcfa/src/containers/string_res.hfa

    r4e8df745 r1733184  
    8787}
    8888
    89 void assign(string_res &s, const char* buffer, size_t bsize); // copy specific length from buffer
    90 static inline void ?=?(string_res &s, const char* other) {  // copy from string literal (NULL-terminated)
    91     assign(s, other, strlen(other));
     89string_res & assign(string_res &s, const char* buffer, size_t bsize); // copy specific length from buffer
     90static inline string_res & ?=?(string_res &s, const char* other) {  // copy from string literal (NULL-terminated)
     91    return assign(s, other, strlen(other));
    9292}
    93 void ?=?(string_res &s, const string_res &other);
    94 void ?=?(string_res &s, string_res &other);
    95 void ?=?(string_res &s, char other);
     93string_res & ?=?(string_res &s, const string_res &other);
     94string_res & ?=?(string_res &s, string_res &other);
     95string_res & ?=?(string_res &s, char other);
    9696
    9797void ^?{}(string_res &s);
Note: See TracChangeset for help on using the changeset viewer.