diff options
| author | Syndamia <kamen@syndamia.com> | 2026-04-21 21:34:40 +0300 |
|---|---|---|
| committer | Syndamia <kamen@syndamia.com> | 2026-04-21 21:35:17 +0300 |
| commit | 9b1695b9f2eda40c61bd201607d9296ebaf37c78 (patch) | |
| tree | fe005402c18b65149948779043947c8575dbbd03 /Array.c | |
| parent | 6e7d4efab4e3b35a68dfd5cfbeda6373b86520ff (diff) | |
| download | foollib-9b1695b9f2eda40c61bd201607d9296ebaf37c78.tar foollib-9b1695b9f2eda40c61bd201607d9296ebaf37c78.tar.gz foollib-9b1695b9f2eda40c61bd201607d9296ebaf37c78.zip | |
fix(A_new): Handle out of memory condition
Diffstat (limited to 'Array.c')
| -rw-r--r-- | Array.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -31,6 +31,9 @@ A_new(BumpArena b, usize element_size, usize length) { }; void* start = B_alloc(b, sizeof(am) + element_size * length); + if (NULL == start) + return NULL; + memcpy(start, &am, sizeof(am)); return start + sizeof(am); } |
