malloc.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /****************************************************************************
  2. * include/malloc.h
  3. *
  4. * Licensed to the Apache Software Foundation (ASF) under one or more
  5. * contributor license agreements. See the NOTICE file distributed with
  6. * this work for additional information regarding copyright ownership. The
  7. * ASF licenses this file to you under the Apache License, Version 2.0 (the
  8. * "License"); you may not use this file except in compliance with the
  9. * License. You may obtain a copy of the License at
  10. *
  11. * http://www.apache.org/licenses/LICENSE-2.0
  12. *
  13. * Unless required by applicable law or agreed to in writing, software
  14. * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  15. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  16. * License for the specific language governing permissions and limitations
  17. * under the License.
  18. *
  19. ****************************************************************************/
  20. #ifndef __INCLUDE_MALLOC_H
  21. #define __INCLUDE_MALLOC_H
  22. /****************************************************************************
  23. * Included Files
  24. ****************************************************************************/
  25. #include <stdlib.h>
  26. /****************************************************************************
  27. * Pre-processor Definitions
  28. ****************************************************************************/
  29. /****************************************************************************
  30. * Public Type Definitions
  31. ****************************************************************************/
  32. struct mallinfo
  33. {
  34. int arena; /* This is the total size of memory allocated
  35. * for use by malloc in bytes. */
  36. int ordblks; /* This is the number of free (not in use) chunks */
  37. int mxordblk; /* Size of the largest free (not in use) chunk */
  38. int uordblks; /* This is the total size of memory occupied by
  39. * chunks handed out by malloc. */
  40. int fordblks; /* This is the total size of memory occupied
  41. * by free (not in use) chunks. */
  42. };
  43. /****************************************************************************
  44. * Public Function Prototypes
  45. ****************************************************************************/
  46. #if defined(__cplusplus)
  47. extern "C"
  48. {
  49. #endif
  50. struct mallinfo mallinfo(void);
  51. size_t malloc_usable_size(FAR void *ptr);
  52. #if defined(__cplusplus)
  53. }
  54. #endif
  55. #endif /* __INCLUDE_MALLOC_H */