diff options
| author | Fabrice <fabrice@schaub-dev.xyz> | 2026-03-02 12:48:58 +0100 |
|---|---|---|
| committer | Fabrice <fabrice@schaub-dev.xyz> | 2026-03-02 12:48:58 +0100 |
| commit | 8d0fa5880fa4c991603cfa603d31d3f17e3067e5 (patch) | |
| tree | dab0dff18c0905c2c0e4f7c8b26fda19b3e94af8 | |
| parent | 5d0b25f99400ac6609e8f8b77d54db724e8bd8d9 (diff) | |
using memset for large struct
| -rw-r--r-- | src/source.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/source.cc b/src/source.cc index 30290f4..c13fefc 100644 --- a/src/source.cc +++ b/src/source.cc @@ -43,7 +43,8 @@ bool buffer_init(Buffer* buffer, const Allocator* allocator, void buffer_deinit(Buffer* buffer) { slice_deallocate(buffer->allocator, &buffer->file); slice_deallocate(buffer->allocator, &buffer->content); - buffer->allocator = nullptr; + + memset(buffer, 0, sizeof(*buffer)); } struct Buffer_Manager { |
