您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

20 行
343B

  1. /*
  2. * This file is a part of SMalloc.
  3. * SMalloc is MIT licensed.
  4. * Copyright (c) 2017 Andrey Rys.
  5. */
  6. #include "smalloc_i.h"
  7. void *sm_zalloc_pool(struct smalloc_pool *spool, size_t n)
  8. {
  9. void *r = sm_malloc_pool(spool, n);
  10. if (r) memset(r, 0, n);
  11. return r;
  12. }
  13. void *sm_zalloc(size_t n)
  14. {
  15. return sm_zalloc_pool(&smalloc_curr_pool, n);
  16. }