name.h 510 B

123456789101112131415161718
  1. #pragma once
  2. #include "pocketpy/objects/base.h"
  3. #include "pocketpy/common/smallmap.h"
  4. typedef struct {
  5. char* data; // null-terminated data
  6. int size; // size of the data excluding the null-terminator
  7. py_TValue obj; // cached `str` object (lazy initialized)
  8. } RInternedEntry;
  9. typedef struct {
  10. c11_smallmap_s2n interned;
  11. c11_vector /* T=RInternedEntry */ r_interned;
  12. } InternedNames;
  13. void InternedNames__ctor(InternedNames* self);
  14. void InternedNames__dtor(InternedNames* self);