mirror of
https://github.com/zeek/zeek.git
synced 2025-10-10 10:38:20 +00:00
memory management for assignment to record fields
This commit is contained in:
parent
498d8c4bde
commit
7adcd1b27b
4 changed files with 60 additions and 19 deletions
11
src/Type.h
11
src/Type.h
|
@ -599,6 +599,11 @@ public:
|
|||
const TypeDecl* FieldDecl(int field) const;
|
||||
TypeDecl* FieldDecl(int field);
|
||||
|
||||
// Returns flags corresponding to which fields in the record
|
||||
// have types requiring memory management (reference counting).
|
||||
const std::vector<bool>& ManagedFields() const
|
||||
{ return managed_fields; }
|
||||
|
||||
int NumFields() const { return num_fields; }
|
||||
|
||||
/**
|
||||
|
@ -634,6 +639,12 @@ public:
|
|||
protected:
|
||||
RecordType() { types = nullptr; }
|
||||
|
||||
void AddField(unsigned int field, const TypeDecl* td);
|
||||
|
||||
// If we were willing to bound the size of records, then we could
|
||||
// use std::bitset here instead.
|
||||
std::vector<bool> managed_fields;
|
||||
|
||||
int num_fields;
|
||||
type_decl_list* types;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue