| 259 | #endif |
| 260 | |
| 261 | void *cbm_alloc(cbm_mem_class_t cls, size_t bytes) { |
| 262 | MEMEV_HINT(cls); |
| 263 | void *block = CBM_BACKING_MALLOC(bytes ? bytes : CBM_ALLOC_ONE); |
| 264 | MEMEV_ALLOCATED(block, bytes, 0); |
| 265 | if (!block) { |
| 266 | return NULL; |
| 267 | } |
| 268 | class_add(cls, charge_size(block, bytes), CBM_ALLOC_ONE); |
| 269 | return block; |
| 270 | } |
| 271 | |
| 272 | void *cbm_calloc(cbm_mem_class_t cls, size_t bytes) { |
| 273 | MEMEV_HINT(cls); |