@ @ requires \valid(data); @*/
| 26 | @ requires \valid(data); |
| 27 | @*/ |
| 28 | static inline alloc_data_t *file_add_data(alloc_data_t *data, const uint64_t offset, const unsigned int content) |
| 29 | { |
| 30 | if(!(data->start <= offset && offset <= data->end)) |
| 31 | { |
| 32 | log_critical("file_add_data: bug\n"); |
| 33 | return data; |
| 34 | } |
| 35 | if(data->start==offset) |
| 36 | { |
| 37 | data->data=content; |
| 38 | return data; |
| 39 | } |
| 40 | if(data->data==content) |
| 41 | return data; |
| 42 | { |
| 43 | alloc_data_t *datanext=(alloc_data_t*)MALLOC(sizeof(*datanext)); |
| 44 | memcpy(datanext, data, sizeof(*datanext)); |
| 45 | data->end=offset-1; |
| 46 | datanext->start=offset; |
| 47 | datanext->file_stat=NULL; |
| 48 | datanext->data=content; |
| 49 | td_list_add(&datanext->list, &data->list); |
| 50 | return datanext; |
| 51 | } |
| 52 | } |
| 53 | |
| 54 | /*@ |
| 55 | @ requires \valid(dst); |
nothing calls this directly
no test coverage detected